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
  • Merging PDF documents in linux Recently I had a dillemma of sorts. I had a document that had printed to pdf.... each page to it's own pdf. I didnt' have time to spend figuring out how to make the document print to one multi-page pdf and so it seemed like it should be pretty easy......
  • "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......
  • Linux Permissions Headache Yikes, what an evening..... it started innocently enough in the afternoon. I have an old Mandrake 10.0 server that I was upgrading clamav on (recent security update). While I was at it, I was reviewing the anti-spam setup to see if I could get any better success with filtering junk......
Blog Traffic Exchange Related Websites
  • 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......
  • Ten Steps To Become a Linux/Unix Geek Until recently, Linux/Unix was considered OS of the geeks. However, with GUI and more desktop Linux distributions, things have simplified on both Linux and Unix. Still you can geek out with Unix/Linux using its terminal. Just follow the steps below to master the terminal. 1. Never used Linux! Get Ubuntu......
  • 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.......
PDF24    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