Some Useful CommandsThe 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. | ||
cd | Change current directory. | |
chgrp | Change the group owner for a file. | |
chmod | Change the permissions of a file. | |
chown | Change the owner of a file. | |
cp | Copy file or directory. | |
diff | Compare the contents of two files. | |
diff3 | Compare the contents of three files. | |
find | Find a file on your hard disk. | |
grep | Find a file with specified contents. | |
less | Display the contents of a file on the screen, one page at a time. | |
ls | List the file names of files in a directory. | |
mkdir | Create a new directory. | |
mv | Change the location of a file. Can be used to change the name of a file. | |
pwd | Show the path to the current directory. | |
rmdir | Remove a directory. | |
touch | Update the last access/modification dates of a file. |
groups
Display the list of existing groups.
passwd
Change your password.
quota
Display used and available disk space for account.
App B
su
Change to the super user or another user account.
unset
Remove an environmental variable.
App B
useradd
Add a new user account.
userdel
Delete a user account.
whoami
Display the current account.
lprm
Remove a file from the printer queue.
lpq
Display information about the jobs in the queue.
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