14

I'm relatively new to programming as a whole and some tutorials have been telling me to use ls -l to look at files in a directory and others have been saying ll. I know that ls is a short list, but is there a difference between the other two?

  • You can inspect how your *sh shell interprets any command with type [command]. type ll results in ll is aliased to 'ls -alF' in my setup. – David Foerster Mar 1 '15 at 0:13
28

This is located in your .bashrc:

alias ll='ls -al'

By taking a look at the manual pages for the command ls, you can see what those two attributes accomplish together:

  1. -a: do not ignore entries starting with ..
  2. -l: use a long listing format.

So you can understand that ls -l would ignore any entry starting with .. That's their only difference.

EDIT:

Let me note, that, as commented, the ll alias differs from installation to installation. In case you are wondering what's yours, please open up a terminal and enter:

alias ll

This will show you how ll is set. You can then look up the additional attributes by typing:

man ls
  • 3
    I have ll is aliased to 'ls -l'... The alias is copied over from the skeleton files so what people have depends on when they installed. – Oli Feb 4 '15 at 9:57
  • 1
    I have ls='ls --color=auto', ll='ls -lh'. Ubuntu 14.04 ships /etc/skel/.bashrc with ls='ls --color=auto' ll='ls -alF, but that's horrible. I use ll when I want sizes/dates/perms, ll -a if I also want dotfiles. – Peter Cordes Feb 4 '15 at 19:21
  • I also use alias l=ll, handy in case I miss a key. – Peter Cordes Feb 4 '15 at 19:25
  • I've got alias ll = ls -alF if this helps anyone. – user323419 Feb 4 '15 at 20:15
  • 2
    For your explanation of -a, you might want to put . in backticks so it's more visible. – cpast Feb 5 '15 at 5:50
6

ll is a common alias for ls -l. It is a part of the default .bashrc, with a couple more options:

$ grep 'alias ll' /etc/skel/.bashrc
alias ll='ls -alF'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.