Searching and Extracting Data From Files Flashcards
Command Line Pipe / Pipeline
The output of first command is used and input for the second command
Xargs command
Enables a user to generate command line options from files or other programs’ output
Standard Output
Normal program messages
Standard Error
Any error messages
/dev/null
Device file that serves as a trash bin for output/errors
cat command
display contents of a file.
wc command
Word count of file
-l line count
head -# command
Return first # things from a file
tail -# command
Return last # things from a file
Regular Expressions
- A way to describe patterns that a user might want to look for in data files
- Similar to wild cards
File-Archiving Tool
Collects a group of files into a single “package” file to easily move around on a single system
tar file.tar /dir command
(Tape archiver)
Used to archive various data files into a single files (archive file) while the original files remain on the disk
tarball
Archive file created from tar command
grep command
Search inside a file
Search for file that contain a specified string
tar -c command
Create a new .tar archive file
tail/head -c
Print last/firs x bytes of data to the screen
cat -n
Display line numbers with the text of a file to the screen
tail -f command
Print the last 10 lines of a file (usually a log file) and continue to print out new lines to the screen as they are added to the file
grep ^term
Search for lines beginning with the given term
grep term$