I keep quite a few command aliases and environment variables which speeds up my use of the command line. However sometimes it can be difficult to recall exactly what I've called one of the ones I haven't used in a while. To help with this problem, I find it handy to define a few easy to remember command aliases to help me search my list of command aliases, environment variables, and recent command history.
alias ag='alias | grep -i'
alias eg='env | grep -i'
alias hg='history | grep -i'
The need to search through command aliases and history are probably somewhat obvious. You may ask why I find the need to keep so many environment variables though. It turns out they're incredibly handy as shortcuts for frequently used directory paths.
For example, I always keep a shortcut called $DT for my Desktop. That makes it very easy to move or copy a file to the Desktop using a short command like "cp filename $DT". It removes the need for me to remember the Desktop path on all the OSes I use on a regular basis (Windows, Linux, and Mac OS X).
That may seem a simplistic use but I also keep environment shortcuts for the paths to all the SDKs (software development kits) and virtual machine shared directories I use. That frees me up to remember more important things.
This blog is intended to give me a place to comment on things which strike my fancy, hence the title. Topics may include computer software or hardware, science, space, books, movies, television programs of a geeky nature, or almost anything else.
Subscribe to:
Post Comments (Atom)
-
A long time ago I was given a bit of advice that has served me well over the years. An engineer with much more experience than I had at the...
-
We lost our very special dog to an osteosarcoma a few days ago. He started limping a little over 4 months ago and it took a while to dia...
-
Most of the longtime Unix users like me love grep. Regular expressions make the silly wildcards available in Windows seem completely underw...
No comments:
Post a Comment