- Chapter 3 Navigating the Linux File System
- Changing Directories with the cd Command
- Listing Directories
- Viewing Text Files
- Creating Files and Directories
- Copying Files and Directories
- Moving and Renaming Files and Directories
- Creating Symbolic Links
- Deleting Files and Directories
- Finding Files and Directories
- Using the GNOME gmc Client
- Using the KDE File Manager kfm
- Searching Text Files
Using the GNOME gmc Client
The GNOME Desktop Environment, which runs with the X Window System, is packaged with a file management application known as the GNOME Midnight Commander, or gmc. gmc is based on an older application called The Midnight Commander. The GNOME version includes an easy-to-use graphical interface which wasn't included in the original.
To launch gmc, select File Manager from the GNOME panel menu, or run the gmc command as follows:
$ gmc &
This will bring up a window like the one shown in Figure 3.1.
Figure 3.1 The GNOME Midnight Commander provides an easy visual interface to the file system. It is also responsible for your GNOME desktop icons.
Creating Directories Using the GNOME gmc Client
When you open gmc, you will find a graphical representation of your directory tree on the left; on the right, you will see the contents of the directory that is highlighted on the left.
To create a new directory, start by selecting File from the menu at the top. Then move down the menu to New and follow the arrow to the right. The submenu that pops up will contain a selection for Directory. This brings up a dialog box where you can enter the name of the directory you want to create. This can either be a subdirectory under the directory highlighted on the left side of gmc, or a complete path name.
An easier method is to select the parent directory on the left and then right-click in the white space around the directory contents on the right. Select New Directory from the pop-up menu. Fill in the dialog box as mentioned earlier.
Copying, Moving, and Renaming Files and Directories Using the GNOME gmc Client
To copy a file with gmc, right-click the file or directory you want to duplicate. The Copy dialog box pops up with a list of options for copying your file. Under the Destination tab, there is a text field where you can type the path where you want to copy the file. You can also select the Browse option to browse the directory tree for the exact location. The other tab in this dialog box is entitled Advanced Options and allows you to copy directories recursively, preserve symlinks, follow links, and preserve file attributes.
Moving a file or directory with gmc is easy. Grab the file or directory with your mouse and drop it in the directory where you want to put it. Or if you prefer, you can highlight the file or directory and select Move from the File menu. The third choice is to right-click the file or directory and select Move from the pop-up menu.
To rename a file or directory, right-click the file or directory from the right pane of the window. Now select Properties from the pop-up menu and you will see the Properties dialog box. Under the Statistics tab is a field marked File Name. Change the filename in the text field and click OK.
Creating Symbolic Links Using the GNOME gmc Client
When you right-click a file or directory in gmc, one option on the pop-up menu is Symlink. Selecting this option will present you with a dialog box where you can type the name and path of the symlink you'd like to create. The symlink will point at the file you selected.
Deleting Files and Directories using the GNOME gmc Client
Deleting a file or directory in gmc can be done by selecting the file or directory in the right pane and choosing Delete from the pop-up menu. If you choose to delete a directory that isn't empty, you'll see a dialog box asking whether you want to delete everything in it first. If you are deleting multiple directories at once, you can make your answer apply to all the remaining directories as well.
Searching for Files with GNOME's Search Tool
The GNOME Search Tool provides another way to locate files in the directory tree. It can be launched from the Utilities section of the GNOME panel menu or from the command line like this:
$ gsearchtool &
After typing in the directory to start find in, you can add or remove search criteria as seen in Figure 3.2.
Figure 3.2 You can search for files using complex search dialogs with gsearchtool by entering criteria in text fields and selecting options in drop-down boxes. Each time you click the Add button, gsearchtool will add more fields.