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
  • Linux Livecd Download This should probably go in the Windows tech support category too... but, as I've talked about before I've spent a good amount of time using different linux livecd's. I've even made a few livecd's of my own with Mandrake (now mandriva) linux, using the mklivecd scripts. One of the nice......
  • "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......
  • Rsync for easy (and quick) backups I've got to say, I haven't spent ENOUGH time with rsync to really be fluent in how I could put it to use.... A week or so ago I was reading this list of essential Linux software by a guy that moved from Mac OS X to linux because he......
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......
  • 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......
  • 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......
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