BashItOut

Linux ll command alias

August 22nd, 2009

I’ve recently found using ll a real finger saver when you’re hunting around on the command line. ll is not a command on its own, but merely an alias setup on most distros for the (very slightly longer) ls -l.

That’s great, but when I say most distros, that means sometimes you need to set it up yourself, as I did on my newly purchased Debian VPS. It’s really easy to do.

On the command line just type:

alias ll="ls -l"

You can now save yourself 3 whole keystrokes per directory listing!

The same principle applies to any other command too e.g. If you’re constantly checking your Apache error logs whilst programming a web app, try something like

alias logtail="tail /var/log/apache2/error.log"

Now you can just type logtail and save your fingers some more work!

Bear in mind, this will only last for as long as the terminal is open. To make this a permanent alias you will need to do something like adding that line to the bottom of your .bashrc file, or to a .bash_aliases file.

In Ubuntu, the line is already in your .bashrc, so just needs uncommenting.


Tags: Linux

blog comments powered by Disqus

About

@MTerzza Twitter Icon

+MikeTerzza Google Plus Icon

Atom | RSS RSS Icon

Recent Posts:

RTL SDR Frequency Drift Offset

Random Seriousness with Python and Password Generation

Random Fun and the Busy Linux Geek

Ampersands & on the command line

Killing processes in Linux