Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using Mac OS X. When I SSH into servers I find the ll command useful, but it's not available on my local machine. How can I install it?

share|improve this question

4 Answers 4

up vote 25 down vote accepted

MacOS:

alias ll='ls -lG'

Linux:

alias ll='ls -l --color=auto'

Stick that in ~/.bashrc.

share|improve this answer
    
It worked!, anyway --color=auto parameter made an error. Other parts worked well. –  Eonil Jan 6 '12 at 7:10
3  
Ah right, BSD ls doesn't support --color. –  Ignacio Vazquez-Abrams Jan 6 '12 at 7:12
    
One more, I had to add the command ~/.profile instead of ~/.bashrc to make it work. Maybe this is Mac OS X specific. –  Eonil Jan 6 '12 at 12:12
7  
You need alias ll='ls -lG' for the same effect in macosx. –  Burhan Khalid Jan 6 '12 at 13:01
4  
I needed to add alias ll='ls -lG' to my ~/.bash_profile to make it work (in Lion, if that matters) –  jessica Jul 28 '12 at 1:58

In OS X 10.9.5 Mavericks you have to add an alias command to your bash profile file in your home folder:

~/.bash_profile

which is equivalent to your user path at

/Users/YOUR_USER_NAME/.bash_profile

To see that file in finder you have to activate the display of hidden files (e.g. using the app InVisible). Otherwise you can simply use your terminal to locate it and edit it with nano:

nano ~/.bash_profile

Then add an alias command to the end of that file. The standard ll alias would be

alias ll='ls -lG'

but I prefer

alias ll='ls -lGaf'

which also shows all hidden files (starting with a dot) and sorts the output case-insensitive.

share|improve this answer

Add alias ll='ls -lG' to your ~/.profile with your favorite $EDITOR.

With this method, remember that you'll have to start a new terminal session (or source ~/.profile to be able to use ll).

share|improve this answer
    
Giving users steps to reproduce your solution is great, but being specific and concise is too. –  HalosGhost Sep 15 at 19:30

Run type ll to see where the ll command is coming from. ll is not a standard command, but many distributions predefine it to an alias for ls with some preset options. The output of type ll gives you the definition of the alias, or you can look for it in your shell configuration file (~/.bashrc if your shell is bash). Copy the definition to ~/.bashrc on the other machine.

Bash handles its configuration file in a slightly odd way: it loads ~/.bashrc in all interactive shells except the ones that are also login shells. Bash only loads ~/.bash_profile (if it exists, otherwise ~/.profile) in a login shell. To make sure that your .bashrc is read when it should be, put this line in your ~/.bash_profile:

case $- in *i*) . ~/.bashrc;; esac
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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