| The tables below list some of the most useful Linux commands. The tables show the command name, what the command does, and where to find more information. In addition, sort and grep, two of the more flexible commands, are documented in this chapter to show the use of complex commands. Linux commands can be used on the command line or in shell scripts, programs that perform tasks in the Linux shell. Creating shell scripts is discussed in Chapter 19. Table 7-1. Some Useful Linux File Management CommandsCommand | What it does | Details in |
|---|
cat | Display contents of a file. | Chapter 9 | cd | Change current directory. | Chapter 9 | chgrp | Change the group owner for a file. | Chapter 9 | chmod | Change the permissions of a file. | Chapter 9 | chown | Change the owner of a file. | Chapter 9 | cp | Copy file or directory. | Chapter 9 | diff | Compare the contents of two files. | Chapter 9 | diff3 | Compare the contents of three files. | Chapter 9 | find | Find a file on your hard disk. | Chapter 9 | grep | Find a file with specified contents. | Chapter 9 | less | Display the contents of a file on the screen, one page at a time. | Chapter 9 | ls | List the file names of files in a directory. | Chapter 9 | mkdir | Create a new directory. | Chapter 9 | mv | Change the location of a file. Can be used to change the name of a file. | Chapter 9 | pwd | Show the path to the current directory. | Chapter 9 | rmdir | Remove a directory. | Chapter 9 | touch | Update the last access/modification dates of a file. | Chapter 9 |
Table 7-2. Some Useful Linux Account Management CommandsCommand | What it does | Details in |
|---|
env | Set or display environmental variables. | App B | groupadd | Add a new group. | Chapter 8 | groups | Display the list of existing groups. | Chapter 8 | passwd | Change your password. | Chapter 8 | quota | Display used and available disk space for account. | App B | su | Change to the super user or another user account. | Chapter 8 | unset | Remove an environmental variable. | App B | useradd | Add a new user account. | Chapter 8 | userdel | Delete a user account. | Chapter 8 | whoami | Display the current account. | Chapter 8 | Table 7-3. Some Useful Linux Print Job Management CommandsCommand | What it does | Details in |
|---|
lpr | Send a file to the printer queue. | Chapter 14 | lprm | Remove a file from the printer queue. | Chapter 14 | lpq | Display information about the jobs in the queue. | Chapter 14 |
Table 7-4. Some Miscellaneous Useful Linux CommandsCommand | What it does | Details in |
|---|
whereis | Find the location of a program. | App B | tar | Put files into and retrieve files from an archive file. | Chapter 10 | ftp | Transfer files from one computer to another. | App B | clear | Clear the screen. | App B | date | Display the current date and time. | App B | gzip | Compress files. | App B | gunzip | Uncompress files. | App B |
|