On UNIX, as on Linux, all entities are in some way or another
presented to the system as files with the appropriate file
properties. Use of (predefined) paths allows the users and the
system admin to find, read and manipulate files.
We've made our first steps toward becoming an expert: we
discussed the real and the fake structure of the file system, and
we know about the Linux file security model, as well as several
other security precautions that are taken on every system by
The shell is the most important tool for interaction with the
system. We learned several shell commands in this chapter, which
are listed in the table below.
Table 3-10. New commands in chapter 3: Files and the file
||GNU shell program.
||Send content of file(s) to
||Enter directory. cd is a bash built-in command.
||Change the group ownership of
file(s) to newgroup
||Change access permissions on
||Change file owner and group
|cp sourcefile targetfile
||Copy sourcefile to targetfile.
||Reports on used disk space on the
partition containing file.
||Display a line of text
||Part of bash that announces variables and their values to the
||Determine file type of filename.
|find path expression
||Find files in the file system
|grep PATTERN file
||Print lines in file containing the search pattern.
||Send the first part of file to standard output
||Prints real and effective user
name and groups.
||Read documentation about command.
||View file with a powerful viewer.
|ln targetfile linkname
||Make a link with name linkname to targetfile.
||Print all accessible files
matching the search pattern.
||Prints directory content.
||Format and display online (system)
manual pages for command.
||Make a new empty directory.
|mv oldfile newfile
||Rename or move oldfile.
||Log in to a new group.
||Print the present or current
||Show disk usage and limits.
||Removes files and
||Print the last part of file.
||Show or change new file creation
||Counts lines, words and characters
||Shows the full path to command.
We also stressed the fact that you should READ THE MAN PAGES.
This documentation is your first-aid kit and contains the answers
to many questions. The above list contains the basic commands that
you will use on a daily basis, but they can do much more than the
tasks we've discussed here. Reading the documentation will give you
the control you need.
Last but not least, a handy overview of file permissions:
Table 3-11. File permissions