la accidentally instead of
ls to view the contents of a directory and it produces exactly the same output as
Why is this? Surely it doesn't make sense to have two commands that do the exact same thing.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
la is defined as an alias in Ubuntus
~/.bashrc file together with a few others.
la is simply an
ls -A as you can see in the following snippet from the
# this alias is defined earlier to grant colored output alias ls='ls --color=auto' # some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' alias li='ls -lF'
la is an alias for
ls -A, as stated by other answers. As such, it can't be used in shell scripts, while
Your computer has multiple aliased commands. A complete list can be obtained by executing
alias. On my machine it prints this:
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias ls='ls --color=auto'
--color=auto means colour will be turned off when not printing directly to STDOUT.