BCCS199_Session_10 Flashcards
In Linux (like Unix before it), nearly all configuration information is stored in…?
text files.
Contrast this with Windows, which stores configuration information in a huge, monolithic database called The Registry.
Text files are generally easier to set up and work with.
Linux includes a rich set of tools for viewing and editing text files. The following chapters describe some of these.
cut command…?
selects columns of text in a text file.
Commands like head, tail, and grep can be considered to make…?
“horizontal” cuts in a file.
cut can be considered to make…?
“vertical” cuts in a file.
Switches for the cut command…?
- Select character columns with the –c switch.
- Select fields with the –f switch.
- Select bytes with the –b switch (essentially the same as –c in most circumstances).
- Specify the field delimiter character with the –d switch (tab is default).
Example on slide 5 to 6
Paste command…?
Appends files horizontally, line by line
See example on slide 7
The diff command…?
Compares two files, and reports the differences between them.
See example on slide 8
diff command line switches:
- c : Generate the context sensitive format
- C, –context[=N] Generate the context sensitive format, using N lines of context, if specified.
- u Generate the unified format.
- U, –unified[=N] Generate the unified format, using N lines of context, if specified.
- N Another format for specifying N lines of context. Only used with -c or -u.
- y, –side-by-side Generate the side by side format.
- W, –width=N Use N columns when generating side by side format.
–left-column Print only the left column when using the side by side format.
-q, –brief Only report if files differ, not the details on the difference.
diff can be quite picky, and report all sorts of changes which are…?
trivial and ultimately meaningless. Here are some switches to ease the pain:
- b, -w, –ignore-all-space Ignore white space when comparing lines.
- B, –ignore-blank-lines Ignore white space when comparing lines.
- i, –ignore-case Ignore changes in case (i.e., consider upper and lower case characters equivalent.)
- I, –ignore-matching-lines=regex Ignore changes that insert or delete lines which match the mandatory argument regex.
cut command…?
selects columns of text in a text file.
Commands like head, tail, and grep can be considered to make…?
“horizontal” cuts in a file.
cut can be considered to make…?
“vertical” cuts in a file.
Switches for the cut command…?
- Select character columns with the –c switch.
- Select fields with the –f switch.
- Select bytes with the –b switch (essentially the same as –c in most circumstances).
- Specify the field delimiter character with the –d switch (tab is default).
Example on slide 5 to 6
Paste command…?
Appends files horizontally, line by line
See example on slide 7
The diff command…?
Compares two files, and reports the differences between them.
See example on slide 8