Linux Commands Flashcards
aspell
Checks a file for spelling errors
bzip2
Compresses or decompresses files—page 615
cat
Joins and displays files
cmp
Compares two files
comm
Compares sorted files
cp
cp Copies files
cpio
Creates an archive, restores files from an archive, or copies a directory
hierarchy
cut
Selects characters or fields from input lines
dd
Converts and copies a file
diff
Displays the differences between two text files
ditto
Copies files and creates and unpacks archives
find
Finds files based on criteria
fmt
Formats text very simply
grep
Searches for a pattern in files
gzip
Compresses or decompresses files
head
Displays the beginning of a file
less
Displays text files, one screen at a time
ln
Makes a link to a file
lpr
Sends files to printers
ls
Displays information about one or more files
man
Displays documentation for commands
mkdir
Creates a directory
mv
Renames or moves a file
od
Dumps the contents of a file
open
Opens files, directories, and URLs
otool
Displays object, library, and executable files
paste
Joins corresponding lines from files
pax
Creates an archive, restores files from an archive, or copies a directory
hierarchy
plutil
Manipulates property list files
pr
Paginates files for printing
rm
Removes a file (deletes a link)
rmdir
Removes directories
sed
Edits a file noninteractively
sort
Sorts and/or merges files
split
Divides a file into sections
strings
Displays strings of printable characters
tail
Displays the last part (tail) of a file
tar
Stores or retrieves files to/from an archive file
touch
Creates a file or changes a file’s access and/or modification time
uniq
Displays unique lines
wc
Displays the number of lines, words, and bytes
ftp
Transfers files over a network
rcp
Copies one or more files to or from a remote system
rlogin
Logs in on a remote system
rsh
rsh Executes commands on a remote system
rsync
Copies files and directory hierarchies securely over a network
scp
Securely copies one or more files to or from a remote system
ssh
Securely executes commands on a remote system
telnet
Connects to a remote system over a network
cd
Changes to another working directory
chgrp
Changes the group associated with a file
chmod
Changes the access mode (permissions) of a file
chown
Changes the owner of a file and/or the group the file is associated
with
date
Displays or sets the system time and date
df
Displays disk space usage
dscl
Displays and manages Directory Service information
dmesg
Displays kernel messages
du
Displays information on disk usage by directory hierarchy and/or
file
file
file Displays the classification of a file
finger
Displays information about users
GetFileInfo
Displays file attributes
kill
Terminates a process by PID
killall
Terminates a process by name
nice
Changes the priority of a command
nohup
Runs a command that keeps running after you log out
ps
Displays process status
renice
Changes the priority of a process
SetFile
Sets file attributes
sleep
Creates a process that sleeps for a specified interval
stat
Displays information about files
stty
Displays or sets terminal parameters
sysctl
Displays and alters kernel variables
top
Dynamically displays process status
umask
Establishes the file-creation permissions mask
w
Displays information about system users
which
Shows where in PATH a command is located
who
Displays information about logged-in users
awk
Searches for and processes patterns in a file
configure
Configures source code automatically
gawk
Searches for and processes patterns in a file
gcc
Compiles C and C++ programs
make
Keeps a set of programs current
mawk
Searches for and processes patterns in a file
at
Executes commands at a specified time
cal
Displays a calendar
crontab
Maintains crontab files
diskutil
Checks, modifies, and repairs local volumes
echo
Displays a message
expr
Evaluates an expression
fsck
Checks and repairs a filesystem
launchctl
Controls the launchd daemon
mkfs
Creates a filesystem on a device
Mtools
Uses DOS-style commands on files and directories
tee
Copies standard input to standard output and one or more files
test
Evaluates an expression
tr
Replaces specified characters
tty
Displays the terminal pathname
tune2fs
Changes parameters on an ext2, ext3, or ext4 filesystem
xargs
Converts standard input to command lines
Common Options
Several GNU utilities share the options listed in Table V-2. The utilities that use
these options are marked as such.
Table V-2
Common command-line options
Option Effect
– A single hyphen appearing in place of a filename instructs the utility to accept
standard input in place of the file.
–– A double hyphen marks the end of the options on a command line. You can fol-
low this option with an argument that begins with a hyphen. Without this
option the utility assumes that an argument that begins with a hyphen is an
option.
––help Displays a help message for the utility. Some of these messages are quite long;
using a pipe, you can send the output through less to display it one screen at
a time. For example, you could give the command ls ––help | less. Alterna-
tively, you can send the output through a pipe to grep if you are looking for
specific information. For example, you could give the following command to
get information on the –d option to ls : ls ––help | grep –– –d. See the pre-
ceding entry in this table for information on the double hyphen.
––version Displays version information for the utility.