Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I set ls so that when I type ls it actually runs ls -l. This Sounds minor but I'm trying to save keystrokes wherever I can. This is on Ubuntu 10.10.

share|improve this question

migrated from Mar 29 '11 at 2:02

This question came from our site for professional and enthusiast programmers.

Look up the alias command.

alias list='ls -l'

If you want this to "stick" add it to your .bashrc file.

share|improve this answer
As mentioned in another answer, you can also create an alias called ls, to "replace" the regular ls shell built-in. – oKtosiTe Mar 29 '11 at 10:22
Thanks, I was just making it explicit that you could rename the shortcut. – Andrew White Mar 29 '11 at 11:58
Thanks! Works great...I went with alias l="ls -l" and commented out the previous "l" alias in the .bashrc file. – user73919 Mar 30 '11 at 17:57

The normal pattern is to have ll aliased to this.

In Ubuntu 10 it is already done.

Here is an extract from the default .bashrc:

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

My .bashrc looks like this:

alias   l='ls --color=always -F'
alias  ll='ls --color=always -F -lh'
alias   L='ls --color=always -F     -L'
alias  LL='ls --color=always -F -lh -L'
alias  la='ls --color=always -F        -a'
alias lla='ls --color=always -F -lh    -a'
alias  l.='ls --color=always -F        -A --ignore=\*'
alias ll.='ls --color=always -F -lh    -A --ignore=\*'

Note: changing the meaning of an existing command is considered dangerous, e.g., alias ls='ls -l'. It can change the behavior of (badly written, though most) scripts.

share|improve this answer

You can use the alias command.

alias ls="ls -l"

You can either type this out in a shell session, or you can put it in a file to be sourced, a good one would be ~/.bashrc. If you run it in a shell session, the alias will exist until you exit the shell. If you put it in your a file and source it each time the shell is run (such as by simply putting it in ~/.bashrc), the alias will be created each time you open a shell.

share|improve this answer
Care to explain the downvote? – Wuffers Mar 29 '11 at 21:05


alias ls="ls -l"

in your ~/.bashrc file.

share|improve this answer

You must log in to answer this question.