/initrd | Initial RAM disk boot support (used during boot time) |
/lib | Shared libraries, kernel modules |
/lost+found | Directory for recovered files (if found after a file system check) |
/media | Mount point for removable media, such as DVDs and floppy disks |
/mnt | Usual mount point for local, remote file systems |
/opt | Add-on software packages |
/proc | Kernel information, process control |
/root | Super user (root home) |
/sbin | System commands (mostly root only) |
/selinux | Holds the data for SELinux, the security component of Fedora |
/sys | Real-time information on devices used by the kernel |
/tmp | Temporary files |
/usr | Secondary software file hierarchy |
/var | Variable data (such as logs); spooled files |
Some of the important directories in Table 4.1, such as those containing user and root commands or system configuration files, are discussed in the following sections. You use and edit files under these directories when you use Fedora.
Linux also includes a number of GNU commands you can use to search the file system. These include the following:
> whereis
command—Returns the location of the command and its man page.
> whatis
command — Returns a one-line synopsis from the command's man page.
> locate
file command — Returns locations of all matching file(s); an extremely fast method of searching your system because locate searches a database containing an index of all files on your system. However, this database (about 4MB in size and named slocate.db
, under the /var/lib/slocate
directory) is built daily at 4:20 a.m. by default, and does not contain pathnames to files created during the workday or in the evening. If you do not keep your machine on constantly, you can run the updatedb
command as the super user to manually start the building of the database.
> apropos subject
command — Returns a list of commands related to subject.
Managing Files with the Shell
Managing files in your home directory involves using one or more easily remembered commands. If you have any familiarity with the now-ancient DOS, you recognize some of these commands (although their names differ from those you remember). Basic file management operations include paging (reading), moving, renaming, copying, searching, and deleting files and directories. These commands include the following:
> cat
— Outputs contents of filename to display
> less
— Allows scrolling while reading contents of filename
> mv
— Renames
to
> mv
— Moves file to specified directory
> cp
— Copies
and creates
> rm
— Deletes file
> rmdir
— Deletes directory (if empty)
> grep
— Searches through files(s) and displays lines containing matching string