Cleaning Up: Ls .Hidden Ls .Hidden - A Ls
Cleaning Up: Ls .Hidden Ls .Hidden - A Ls
You
can still list its contents using ls .hidden, but as it only contains a single file which is,
itself, hidden you won’t get much output. But you can use the -a (show all) switch
to ls to make it show everything in a directory, including the hidden files and folders:
ls
ls -a
ls .hidden
ls -a .hidden
Notice that the shortcuts we used earlier, . and .., also appear as though they’re real
directories.
As for our recently installed tree command, that works in a similar way (except
without an appearance by . and ..):
tree
tree -a
Switch back to your home directory (cd) and try running ls without and then with
the -a switch. Pipe the output through wc -l to give you a clearer idea of how many
hidden files and folders have been right under your nose all this time. These files
typically store your personal configuration, and is how Unix systems have always
offered the capability to have system-level settings (usually in /etc) that can be
overridden by individual users (courtesy of hidden files in their home directory).
You shouldn’t usually need to deal with hidden files, but occasionally instructions
might require you to cd into .config, or edit some file whose name starts with a dot.
At least now you’ll understand what’s happening, even when you can’t easily see the
file in your graphical tools.
Cleaning up
We’ve reached the end of this tutorial, and you should be back in your home
directory now (use pwd to check, and cd to go there if you’re not). It’s only polite to
leave your computer in the same state that we found it in, so as a final step, let’s
remove the experimental area that we were using earlier, then double-check that it’s
actually gone:
rm -r /tmp/tutorial
ls /tmp