3

I have a bunch of commands that I commonly use. For example:

du -h --max-depth=1 /home

Unfortunately, my brain has very little room left for these sorts of things. I currently keep a text file on my desktop for jotting down these commands -- but I'm wondering if there's a better way to do this right from the command line...

Ideally, I could create a alias command that would open a list of my favorite commands...for example:

mfc

would open my list of favorite commands and then I could quickly copy and exit that to do the command. Anybody got a workflow they'd like to suggest on this?

Zoredache
  • 131,987

2 Answers2

2

You can use ctrl+r, start typing a command and then a suggestion will appear of a command in you previously used (and that's in the history).

2

I can only tell you what I do, since there are a billion ways to approach this. We use Puppet for systems management at my company so I populate my .bashrc with lots of functions and aliases. For example (your example reminded me of mine):

alias sp='du -mx . --max-depth=1 | sort -nr | head'

If I ever want to remind myself what I've done, I can look at .bashrc, type alias and/or declare -f (to see functions loaded into my shell).

Kyle Smith
  • 9,733