Chp I: Linux Command Line Tools / VII Flashcards

1
Q

The ___ command is useful to view short files. pg. 31

A

cat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

GNU Enscript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

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’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

less ‘filename’ which will then display the first few lines of the filename.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

If moving forward through a file is as easy as pressing the spacebar, what is pressed to move backward? pg. 32

A

Esc followed by V

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which keys move you forward and backward when searching file contents by pressing the slash (/) key? pg. 33

A

Typing n repeats the search forward and typing N repeats the search backward.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you move to a specific line within a file? pg. 33

A

g followed by the line number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What’s the Linux way of existing a program? pg. 33

A

q ( I define as QUIT)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

By Byte= -b ‘list’ or –bytes=’list’
By Character= -c ‘list’ or –characters=’list’
By Field= -f ‘list’ or –fields ‘list’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the 3 points of information provided by the wc command? pg. 34

A

it counts the amount of lines, words and bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A

Bracket Expressions, Range Expressions, Any Single Character, Start and End of Line, Repetition Operators, Multiple Possible Strings, Parentheses, Escaping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

grep command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which command directly modifies a file’s contents by sending the changed file to standard output? pg. 38

A

sed command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

dos2unix file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly