3.3.2. Creating and deleting files and directories
22.214.171.124. Making a mess...
... Is not a difficult thing to do. Today almost every system is networked, so naturally files get copied from one machine to another. And especially when working in a graphical environment, creating new files is a piece of cake and is often done without the approval of the user. To illustrate the problem, here's the full content of a new user's directory, created on a standard RedHat system:
[newuser@blob user]$ ls -al total 32 drwx------ 3 user user 4096 Jan 16 13:32 . drwxr-xr-x 6 root root 4096 Jan 16 13:32 .. -rw-r--r-- 1 user user 24 Jan 16 13:32 .bash_logout -rw-r--r-- 1 user user 191 Jan 16 13:32 .bash_profile -rw-r--r-- 1 user user 124 Jan 16 13:32 .bashrc drwxr-xr-x 3 user user 4096 Jan 16 13:32 .kde -rw-r--r-- 1 user user 3511 Jan 16 13:32 .screenrc -rw------- 1 user user 61 Jan 16 13:32 .xauthDqztLr
On first sight, the content of a "used" home directory doesn't look that bad either:
olduser:~> ls app-defaults/ crossover/ Fvwm@ mp3/ OpenOffice.org638/ articles/ Desktop/ GNUstep/ Nautilus/ staroffice6.0/ bin/ Desktop1/ images/ nqc/ training/ brol/ desktoptest/ Machines@ ns_imap/ webstart/ C/ Documents/ mail/ nsmail/ xml/ closed/ Emacs@ Mail/ office52/ Xrootenv.0
But when all the directories and files starting with a dot are included, there are 185 items in this directory. This is because most applications have their own directories and/or files, containing user-specific settings, in the home directory of that user. Usually these files are created the first time you start an application. In some cases you will be notified when a non-existent directory needs to be created, but most of the time everything is done automatically.
Furthermore, new files are created seemingly continuously because users want to save files, keep different versions of their work, use Internet applications, and download files and attachments to their local machine. It doesn't stop. It is clear that one definitely needs a scheme to keep an overview on things.
In the next section, we will discuss our means of keeping order. We only discuss text tools available to the shell, since the graphical tools are very intuitive and have the same look and feel as the well known point-and-click MS Windows-style file managers, including graphical help functions and other features you expect from this kind of applications. The following list is an overview of the most popular file managers for GNU/Linux. Most file managers can be started from the menu of your desktop manager, or by clicking your home directory icon, or from the command line, issuing these commands:
nautilus : The default file manager in Gnome, the GNU desktop. Excellent documentation about working with this tool can be found at http://www.gnome.org .
konqueror : The file manager typically used on a KDE desktop. The handbook is at http://docs.kde.org .
mc : Midnight Commander, the Unix file manager after the fashion of Norton Commander. All documentation available from http://gnu.org/directory/ or a mirror, such as http://www.ibiblio.org .
These applications are certainly worth giving a try and usually impress newcomers to Linux, if only because there is such a wide variety: these are only the most popular tools for managing directories and files, and many other projects are being developed. Now let's find out about the internals and see how these graphical tools use common UNIX commands.
126.96.36.199. The tools
188.8.131.52.1. Creating directories
A way of keeping things in place is