I assume most people who use the Terminal know about using aliases in the shell to save typing. There have been several previous hints about this (1, 2). I use aliases to store reminders of infrequently used commands and options as much as I do to save typing. When I find out how to do something, I make an alias for it and add a comment line explaining what it is good for.
Read the rest of the article for more details on using the alias file to remember commands...
I keep all my aliases in the file .aliases in my home directory and 'source' this file at the end of my .tcshrc file. It is also possible to keep your aliases in a file named aliases.mine in the ~/Library/init/tcsh folder as has been discussed in previous hints. Since all my aliases are in the one file, I can remind myself of commands by looking through that file for keywords. And of course, I have set up an alias to do this:
I wonder what socket connections exist, so I remind myself of how to find this out by doing:
Read the rest of the article for more details on using the alias file to remember commands...
I keep all my aliases in the file .aliases in my home directory and 'source' this file at the end of my .tcshrc file. It is also possible to keep your aliases in a file named aliases.mine in the ~/Library/init/tcsh folder as has been discussed in previous hints. Since all my aliases are in the one file, I can remind myself of commands by looking through that file for keywords. And of course, I have set up an alias to do this:
# showalias: to remind yourself of an alias (given some part of it)Note that this will show me keywords in the comments as well as in the aliases themselves. This makes it more effective than merely using the 'alias' command which lists the current aliases. Some examples:
alias showalias 'grep \!$ ~/.aliases'
I wonder what socket connections exist, so I remind myself of how to find this out by doing:
% showalias sockThis outputs:
# lsock: to find open socketsI hear some disk activity and wonder which application is accessing the disk, so I remind myself of how to find this out by doing:
alias lsock 'sudo lsof -i'
% showalias diskThis outputs:
# filewho: to show file system usage (to see what is causing disk activity)The above two examples make use of info gleaned from previous hints. Note that in the second example, the keyword ("disk") I searched for was not part of the alias itself, so I just got the comment line - which was sufficient to remind me since it included the name of the alias. (By the way, that alias is: alias filewho 'sudo fs_usage')
•
[4,261 views]

