Thread: viewing aliases

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    10
    Rep Power
    0

    viewing aliases


    How do I see the list of already aliased commands?

    Example:

    alias lsl='ls -l'
    alias rm = 'rm -r' # (oh ho?)

    Now how do I know that such (or other ) aliases exists?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    Type "alias" without any further parameters
  4. #3
  5. Throws Rocks
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio
    Posts
    392
    Rep Power
    14
    Look at your 'profile' file.


    In bash check out ~/.bashrc and ~/.bash_profile
    In csh I think the file is ~/.profile

    Of course ~/ is your home directory.
    Two things have come out of Berkeley, Unix and LSD.
    It is uncertain which caused the other.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    10
    Rep Power
    0
    Thanks a lot.

    BTW, how do I know the aliases that were typed manually from the prompt, other than those from bash scripts files?
  8. #5
  9. No Profile Picture
    hubris, loathing, technology
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    http://frymaster.ca
    Posts
    76
    Rep Power
    14
    you can find all of the bash_profile and bashrc aliases with this:
    Code:
    locate bash_profile bashrc | xargs cat | grep alias | grep -v "^#"
    you see? there's a good one liner!

IMN logo majestic logo threadwatch logo seochat tools logo