How can I tell what command an alias stands for?

20,250

Solution 1

You can use the alias command.

$ alias ll
ll='ls --color=auto -Flh'

Solution 2

You can find a list of aliases on the system with the following command

type -a ll

ll is aliased to `ls -alF'

As a side note, you can see a list of all aliases on the system with

compgen -a

Solution 3

Typing in the command also lists all the aliases in the shell

alias

Solution 4

From the manual page for command:

If either the '-V' or '-v' option is supplied, a description of command is printed.

So, command -v ll might produce this output: alias ll='ls -l'.

Share:
20,250

Related videos on Youtube

Tony Anderson
Author by

Tony Anderson

Automation Engineer Deving all of the Ops in Lehi, Utah. Primarily focused in: Puppet Chef Docker #SOreadytohelp

Updated on September 18, 2022

Comments

  • Tony Anderson
    Tony Anderson over 1 year

    ll is a common alias in many Linux distros.
    How can I tell what it aliases to?

    I've tried checking my .bashrc, but I am not able tell what ll is equivalent to.

  • ILMostro_7
    ILMostro_7 almost 11 years
    you can also type which ll to find out
  • Admin
    Admin almost 11 years
    Also, if you're sure it's an alias, alias ll will tell you.
  • Tony Anderson
    Tony Anderson almost 11 years
    which ll returns nothing on my ubuntu machine. alias ll does show what I'm looking for, thanks!
  • Hauke Laging
    Hauke Laging almost 11 years
    @EvanTeitelman Please make that an answer. I just wanted to but that would feel strange with you having said just that as a comment.
  • Admin
    Admin almost 11 years
    @HaukeLaging: Thanks, I have posted that as an answer.
  • Elder Geek
    Elder Geek over 7 years
    One might go so far as to say " a description or the location of the command is printed" as evidenced by command -v dd which produces /bin/dd