When I type ll
or ls
to list the contents of a directory...
The ls
command shows un-hidden files and folders in a horizontal view.
To show the hidden folders, I have to type ls -a
. I like how this works.
The ll
command shows all files and folders, including hidden ones without needing to add -a
.
I would like ll
to list only unhidden files and folders by default. And if I want to show the hidden ones, I'd like to have to type ll -a
. How can I set this up?
Open the file
.bashrc
in your home directory. The should be an entry which looks like:Remove the last
a
, save the file and open a new shell. Nowll
should work as want you. If you do not find the line, you can add it to your.bashrc
:Technically
ll
is not a command on its own but an alias setup for slightly longer commands; by default it is set tols -l
.For instance on your case, you can set
ll
tols -l
withto your
.bashrc file
.You can also use
alias
to add some time-saving commands. For instance, if you often update from the terminal you can assign a shortcut string to the commandapt-get update and apt-get upgrade
with:Now you can just type
up
to save time.Add these lines:
to the end of
~/.bashrc
, for example using: