Chp I: Linux Command Line Tools / VII Flashcards
The ___ command is useful to view short files. pg. 31
cat
As the pr command was utilized in the ’80s, which command is preferred for modern printer features and also offers Post-Script output? pg. 31
GNU Enscript
The head command provides the first 10 lines of one or more files by default. How can you modify the amount of information displayed? pg. 32
Specify the amount of Bytes or Lines for the head command to display.
Bytes= -c ‘num’ or –bytes=’num’
Lines= -n’num’ or –lines=’num’
As opposed to the head command, the tail command displays the last 10 lines of a file. The tail command offers several additional options that enable duties like ___ and ___. pg. 32
Track a File = -f or –follow which tells tail to keep the file open which is helpful for tracking log files to view activity.
Stop Tracking on Program Termination= –pid=pid tells tail to terminate tracking once the process with a process ID (PID) of pid terminates.
If the more command was an early file pager and the less command was created to be a better version, then what command enables you to read a file a screen at a time? pg. 32
less ‘filename’ which will then display the first few lines of the filename.
If moving forward through a file is as easy as pressing the spacebar, what is pressed to move backward? pg. 32
Esc followed by V
Which keys move you forward and backward when searching file contents by pressing the slash (/) key? pg. 33
Typing n repeats the search forward and typing N repeats the search backward.
How can you move to a specific line within a file? pg. 33
g followed by the line number
What’s the Linux way of existing a program? pg. 33
q ( I define as QUIT)
The cut command extracts portions of input lines and displays them on standard output. What are the 3 specifications used cut from input lines? pg. 33-34
By Byte= -b ‘list’ or –bytes=’list’
By Character= -c ‘list’ or –characters=’list’
By Field= -f ‘list’ or –fields ‘list’
What are the 3 points of information provided by the wc command? pg. 34
it counts the amount of lines, words and bytes
Two forms of regular expression are common: basic and extended. The strength in the use of regular expressions comes in the use of nonalphabetic characters. What are the 8 nonalphabetic noted? pg. 35
Bracket Expressions, Range Expressions, Any Single Character, Start and End of Line, Repetition Operators, Multiple Possible Strings, Parentheses, Escaping
Which command searches for files that contain a specified string and returns the name of the file and a line of context for that string if it’s a text file? pg. 36
grep command
Which command directly modifies a file’s contents by sending the changed file to standard output? pg. 38
sed command
Considering Unix and Linux use a single line feed character, whereas DOS and Windows use a carriage return and a line feed, what’s a special-purpose program you could use to move ASCII files between computers? pg. 40
dos2unix file.txt