In this chapter, you were introduced to the UNIX System concepts of files and directories, and to the basic commands you can use to manage them. You learned how to create, name, and move files and directories. You learned how you can list the files in a directory, view the contents of a file, search for files, and print files.
In the next chapter, you will learn more about entering commands and customizing the UNIX System environment. Chapter 5 explains how to use text editors to create and modify files. More advanced commands for working with files are explained in Chapter 19, “Filters and Utilities.”
Table 3–2 summarizes the commands for using files and directories that were introduced in this chapter.
Command | Use | Command | Use |
---|---|---|---|
ls | List the contents of a directory | locate | Search for files by name |
cat | Display a short file | find | Find files |
touch | Create an empty file | chmod | Change file permissions |
pwd | Show the present directory | umask | Set default file permissions |
cd | Change present directory | chown | Change the owner of a file or directory |
mv | Move a file or directory | chgrp | Change the group of a file or directory |
cp | Copy a file or directory | pg, more, less | Display a file |
In | Create a link | head | Display beginning of a file |
rm | Remove a file or directory | tail | Display end of a file |
mkdir | Make a directory | lp/lpr | Print a file |
rmdir | Remove an empty directory | lpstat/lpq | Check status of a print job |
file | Get file information | cancel/lprm | Cancel a print job |