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?
Asked
Active
Viewed 1.3k times
3 Answers
32
You could just alias ls itself. So something like:
alias ls='ls -ahl'

dlannoye
- 1,746
- 19
- 19
-
3you can but it can be annoying if you forget you've done it better to just use a fresh command imo – FGhilardi Feb 02 '12 at 21:41
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