3.5. Summary

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 default.

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 system

CommandMeaning
bashGNU shell program.
cat file(s)Send content of file(s) to standard output.
cd directoryEnter directory. cd is a bash built-in command.
chgrp newgroup file(s)Change the group ownership of file(s) to newgroup
chmod mode file(s)Change access permissions on file(s)
chown newowner[:[newgroup]] file(s) Change file owner and group ownership.
cp sourcefile targetfileCopy sourcefile to targetfile.
df fileReports on used disk space on the partition containing file.
echo stringDisplay a line of text
exportPart of bash that announces variables and their values to the system.
file filenameDetermine file type of filename.
find path expressionFind files in the file system hierarchy
grep PATTERN filePrint lines in file containing the search pattern.
head fileSend the first part of file to standard output
idPrints real and effective user name and groups.
info commandRead documentation about command.
less fileView file with a powerful viewer.
ln targetfile linknameMake a link with name linkname to targetfile.
locate searchstringPrint all accessible files matching the search pattern.
ls file(s)Prints directory content.
man commandFormat and display online (system) manual pages for command.
mkdir newdirMake a new empty directory.
mv oldfile newfileRename or move oldfile.
newgrp groupnameLog in to a new group.
pwdPrint the present or current working directory.
quotaShow disk usage and limits.
rm fileRemoves files and directories.
rmdir fileRemoves directories.
tail filePrint the last part of file.
umask [value]Show or change new file creation mode.
wc fileCounts lines, words and characters in file.
which commandShows 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

Who\Whatr(ead)w(rite)(e)x(ecute)
u(ser)421
g(roup)421
o(ther)421

mirror server hosted at Truenetwork, Russian Federation.