-bash: alias ls: not found

Discussion in 'macOS' started by IslandRay, Nov 13, 2009.

  1. IslandRay macrumors newbie

    Joined:
    Nov 13, 2009
    Location:
    Hawaii
    #1
    I want to make some simple aliases for my terminal shell and I keep getting this error:

    -bash: alias ls: not found

    $ alias
    $ alias ll
    -bash: alias: ll: not found
    $ alias ll 'ls -lrt'
    -bash: alias: ll: not found
    -bash: alias: ls -lrt: not found

    how do you actually use alias?
     
  2. belvdr macrumors 603

    Joined:
    Aug 15, 2005
  3. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #3
    I have these lines in my .bash_profile file:

    alias x="exit"
    alias l="ls -ahl"
    alias c="clear"
    alias less="less -cemiq"
    alias k="kill -9 %1"

    Those aliases come in handy.

    S-
     
  4. IslandRay thread starter macrumors newbie

    Joined:
    Nov 13, 2009
    Location:
    Hawaii
    #4
    -bash: alias

    Ah! Thanks. The = sign is what was eluding me.

    The the sample .bash_profile will be helpful

    Now the alias I really wanted:

    alias rgrep="find . | xargs %1"

    Thanks sidewinder and belvdr
     
  5. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #5
    You don't need those aliases when using bash. Ctrl-d is exit, ctrl-l is clear and there are many more. I find those much easier to use. They don't show up in the history which can be an advantage.
     
  6. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #6
    Excuse me, you might not need those aliases, but I do.

    I am well aware of those commands. You work in the terminal the way you want and I will work the way I want. I have been using Unix terminals in some form since 1981. I might actually have a clue.....

    S-
     

Share This Page