How do I set
ls so that when I type
ls it actually runs
This Sounds minor but I'm trying to save keystrokes wherever I can. This is on Ubuntu 10.10.
Look up the alias command.
alias list='ls -l'
If you want this to "stick" add it to your
The normal pattern is to have
ll aliased to this.
In Ubuntu 10 it is already done.
Here is an extract from the default
# some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF'
.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.
You can use the
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.