Hidden Files

Hidden Files are files that are not visible to users. They're there, but you can't normally tell they're there. This is normally done so that users will not mistakenly change or delete files that they don't understand. To see them, you have to have your settings changed to show them, or in the terminal, you use a special command.

Hidden Files on Linux and Mac
Hidden files are named just like any other file, except that they always have a '.' character at the beginning. If a file name doesn't start with '.', then it is not hidden. For example, "file1" is not a hidden file, but if a file is named ".file1" it is a hidden file. In fact, you can make a file hidden simply by renaming the file to something that starts with '.' using the terminal. Don't do it though unless you know what you're doing.

Viewing a Hidden File Using the Terminal on Linux or Mac
Hidden files can be seen using the usual "ls" command. Just typing "ls" will not show hidden files, but ls has an "-a" option that will show the hidden files. You can try it in any folder. Type: ls and ls -a into the terminal and see the difference. When ls -a is used, you'll notice two directories that are not seen when plain ls is used: "." and ".." represents the current directory. If you've run a script or a program in the current folder before, you might have had to type "./file1.py". The "./" at the beginning means "the file I'm trying to use is in the current working directory". The ".." represents the parent folder: The folder that the folder you're viewing is in.

Using a Hidden File Using the Terminal on Linux or Mac
You can use hidden files just like normal files, and just like normal files, you can only use them in ways that you are permitted to.

If you want to read a file and output to standard output, and the file name is "file1.txt", you simply use "cat file1.txt". Similarly, if the file name is ".file1.txt", marking it as a hidden file, you simply use "cat .file1.txt".

Person to Ask

 * Bryant
 * Anyone