LPI 1 Article #8: File Management Part 1


File Management
When all is said and done, Linux is a collection of files stored in your hard disk. For this reason, it is very important for anyone striving to be a Linux System Administrator to know how to manage these files already mentioned. Being an operating system that can be used by many users, Linux has got tools that enables you to permit who may access what files in the system. Let us cruise around these file management study, shall we?
Commands used to manage files
The administrator of a Linux system must know how to create, delete, rename, move, share, archive and other manipulations on files. Before all that, there are rules that govern how the files should be named and stuff like that and we shall spend a small section next to demystify the quirks that the file naming has.
How to name the Files
You can name the files in Linux using uppercase, lowercase, control characters numbers and punctuation. Linux different from windows is case sensitive and files such as admin.txt, Admin.txt and ADMIN.TXT are three different files. If you have used windows, you will discover that those file names stated above are the same. For better management, it is advised to stick to the following non-alphanumeric characters in your file names, that is the dot (.), underscore (_), and the dash (-). At the same breath, there are some characters that should not be used in the file naming because they have special meanings to the Linux System. The files can have them but it is not such a good practice. These include the following:
The Asterisk (*)
The back slash (\)
The forward slash (/)
The question mark (?)
And the quotation mark (“)
The file name extension convention is similar to the other OS’s which follows a single dot. Linux file names can have a number of dots as well and in your exploration, you will discover that there are files that begin with a dot. They have a special name these files and you can as well guess. Dot files, bingo! You got it, admin. These dot files have a unique characteristic, they are usually hidden unless explicitly made to be viewed by special command as will be discussed. They especially store configuration files in the home folder.
There are some file names that we cannot afford to forget mentioning. There is this file name that consists of a single dot (.) and another one with two dots (..). The former is used to refer to the present directory you are in while the latter is used to refer to the previous file before the one you are in. To describe it well, let us use an example.
If you are at /home/admin directory, a dot . refers to /home/admin while two dots .. Refers to /home. So if you are at /usr/share/fonts and you would wish to be at /usr, you just do
# cd ../..