Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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).

share|improve this answer
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.