22

Im constantly doing "ls -ahl" whenever I want to list what is in the directory. Is there a way for me to make -ahl the default args passed when I do "ls" or should I just create an alias like "alias lsa=ls -ahl" in bash_profile?

JoshL
  • 1,397
  • 1
  • 12
  • 28

3 Answers3

32

You could just alias ls itself. So something like:

alias ls='ls -ahl'
dlannoye
  • 1,746
  • 19
  • 19
23

Set an alias in your ~/.bash_profile file.

alias ls="ls -ahl"

A couple of common aliases that I use all the time are:

alias ll="ls -lh --color"
alias l="ls -1"
user456584
  • 86,427
  • 15
  • 75
  • 107
Chris Seymour
  • 83,387
  • 30
  • 160
  • 202
4

Create an alias in your .bashrc. You can even call it ls and override the program.

Kevin
  • 53,822
  • 15
  • 101
  • 132