Basic Ultilities Flashcards
ls
lists names of files in current directory
cat
displays a text file
rm
deletes a file
rm -i
Asks permission and then deletes file
hostname
Displays the system name
cp
copies a file
cp a2q2.txt efib.c
Copies a2q2.txt to new file efib.c
mv
The move utility, rename file without copying or move file to different directory
mv memo.txt bird_memo.txt
Changes memo.txt to bird_memo.txt
lpr
Line printer, prints file to actual physical printer
lpstat -p
Lists available printers
lpr -P office report report2
Prints report and then report 2 from office printer
lpq
Lists printer queue
‘grep’ stands for?
Global regular expression print
head -5
Prints first 5 lines of file
tail
Prints last 10 lines of file
sort
Displays file in alphabetic order
sort -u
Displays file in alphabetic order with no duplicates
uniq
Displays file, skipping adjacent duplicate lines
diff -u
Unified format. Displays 2 files being compared - and + preceding, then displays the file contents preceding any differences with - and + options
file
Identifies contents of file
diff -r
Recursively compared files in 2 directories
diff -y
Displays side by side comparison
grep -v *
Displays the non-matches in files in working directory
grep -i -c
Displays the number of matches regardless of capitalization