More Command Line Interface Magic…. Aliases



Enterprise Linux has a good article on some handy aliases under linux that can make CLI usage much more handy. The only warning I would have is to be careful that an alias you want to create doesn’t conflict with another useful program. (One of the comments noted that ld is the executable of the linker).


If there are aliases that are frequently used (or you commonly mistype)…
alias cd..=’cd ..’

Typing alias at the command prompt gives the list of current aliases, entering the above would alias the typed cd.. to mean cd ..

It can be very handy, although you can do dumb things with these… let’s say you’re reckless and rely on rm asking “are you sure you want to delete” and then rm get’s aliased to rm -f (or worse rm -rf…)

So, think carefully about these possibilities.

The hardcoded list of aliases for most distros can be found in your home directory in the .bashrc file.

System wide aliases on many distros are kept in /etc/bashrc (my .bashrc checks that for systemwide stuff.) On Mandrake/Mandriva, aliases come from the /etc/profile.d directory (/etc/bashrc looks in this directory for anything ending with a .sh) Among these can be path modifications, or aliases, such as the file /etc/profile.d/alias.sh which contains all the system-wide aliases.

Related Posts

Blog Traffic Exchange Related Posts
  • Thinclient PXES from 2x and thinstation I have spent about a week with the 2x page open in one of my browsers. I've been trying to get to know PXES' new incarnation. For background. PXES was hosted on sourceforge.net and was an attempt at making a multi-protocol thin-client boot distribution.... In other words, among the files......
  • "rm -f *" undelete I really ought to find a way to alias "rm -f *" to "rm -i" IF the time is between 1 AM and 7 AM.... Last night I was working late (2:30AM or so when this happened). I had just made a few "refinements" to some of my audio streaming......
  • Kdirstat to track space hogs I'm putting this under the Windows tech support category because I've used this on a boot cd before to do the same for Windows as I'm about to describe for Linux. I need to clean up and organize my hard drive(s). But when it comes to actually deleting things you......
Blog Traffic Exchange Related Websites
  • Investment Landscaping with Perennials When you plant a flower, you are making an investment into the future. Certain plants will work well with others, and some will require completely different ground nutrients. So when it comes to planting new flowers, it is like putting money into a savings account or stocks. Play it smart.......
  • Contemporary Fireplace Design Ideas You have many fireplace design ideas to choose from when you're ready to add a beautiful fireplace to your home. Your final choice will depend on some factors like where you plan to put it and your overall floor plan. But no matter how big or small the room might......
  • An A-Z Index of the Bash command line for Linux From SS64.com:   adduser Add a user to the system addgroup Add a group to the system alias Create an alias • apropos Search Help manual pages (man -k) apt-get Search for and install software packages (Debian/Ubuntu) aptitude Search for and install software packages (Debian/Ubuntu) aspell Spell Checker awk Find......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site