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?
How can I set default arguments for "ls" in Linux? [closed]
You could just alias ls itself. So something like:
alias ls='ls -ahl'
you can but it can be annoying if you forget you've done it better to just use a fresh command imo –
Alanson
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"
Create an alias in your .bashrc
. You can even call it ls
and override the program.
© 2022 - 2024 — McMap. All rights reserved.