Utilities Flashcards
(45 cards)
ls -l
Lists the names of files
cat [filename]
Displays a text file
rm [-if] [filename]
Deletes a file
i prompts you for removal
f forces removal
hostname
Displays the system name
cp [source file] [destination file]
copies a file
mkdir [directory name]
Creates a new directory
rmdir [directory name]
Deletes a directory
rm *
Deletes everything in current directory
cd or cd ~
Takes user to home directory
mv [existing file name] [new filename]
Changes the name of a file; can also move files to a different directory
lpr -P [printer name] [filename(s)]
Prints file to certain printer
grep
Searches for a string
head [-number] [filename]
Displays the first number lines of file
tail [-f] [filename]
Monitors lines as they are added to the end of the growing file filename
tail displays end of a file
sort [filename[
Displays a file in order
uniq [filename]
Removes duplicate lines from a file
diff -u [file1] [file2]
Compares two files by breaking long, multiline text into hunks
file [filename]
Identifies contents of files
ln -s [directory 1] [directory 2]
Creates a symbolic link
|
Known as pipeline
Takes the standard output of one process and sends that output as the input of the second process
wc -w [filename or directory]
Displays the number of words in a file or number of files in directory
echo ‘String’ > [filename]
echo displays text
> means redirection
date
Displays time and date
script
Records shell session
Usually save session in file named typescript