0% found this document useful (0 votes)
9 views1 page

Cleaning Up: Ls .Hidden Ls .Hidden - A Ls

The document discusses hidden files and directories in Linux/Unix systems. It explains how to list hidden files and directories using the ls command with the -a switch, and how the tree command also handles hidden files. It notes that hidden files typically store personal configurations and allow overriding system-wide settings on an individual user level. Finally, it describes cleaning up by removing the temporary directory that was used in the tutorial.

Uploaded by

sandeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Cleaning Up: Ls .Hidden Ls .Hidden - A Ls

The document discusses hidden files and directories in Linux/Unix systems. It explains how to list hidden files and directories using the ls command with the -a switch, and how the tree command also handles hidden files. It notes that hidden files typically store personal configurations and allow overriding system-wide settings on an individual user level. Finally, it describes cleaning up by removing the temporary directory that was used in the tutorial.

Uploaded by

sandeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

If you run ls you’ll see that the .hidden directory is, as you might expect, hidden.

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

You might also like