Shared Flashcard Set

Details

Ch 10 Advanced File Processing
Unix The Textbook 2nd Edition
53
Computer Science
Undergraduate 2
11/01/2014

Additional Computer Science Flashcards

 


 

Cards

Term
A set of rules that can be used to specify one or more items in a single character string (sequence of characters).
Definition
regular expressions
Term
Which regular expression operator means alternationA set of rules that can be used to specify one or more items in a single character string (sequence of characters).
Definition
| - x|y|z meaning x,y, or z
Term
Which regular expression operator means any character
Definition
. (dot) - .com means Acom, acom
Term
Which regular expression operator means beginning of line?
Definition
^ caret - ^x means a line starting with x
Term
Which regular expression operator means concatenation
Definition
blank - xyz meaning Xyz
Term
Which regular expression operator means end of line
Definition
$ - x& means a line ending with an x
Term
Which regular expression operator means escape sequence, which cancels the special meaning of the metacharacter following it?
Definition
\ backslash - \* meaning *
Term
Which regular expression operator means delimiter: marks the beginning or end of a regular expression
Definition
/ forward slash - /L.e/ means Love, Live,etc
Term
Which regular expression operator means grouping
Definition
() or \(\) - (xy)+ means xy, xyxy, xyxyxy
Term
Which regular expression operator means optional
Definition
? - xy? meaning x, xy
Term
Which regular expression operator means repetition (0 or more times)
Definition
* - xy* means x, xy, xyy, xyyy
Term
Which regular expression operator means repetition (1 or more times)
Definition
+ - xy+ means xy, xyy, xyyy
Term
Which regular expression operator means Set: Matches any character enclosed in brackets.
Definition
[] - /[Hh]ello/ means Hello, hello
Term
Which regular expression operator means Set: Matches any character not enclosed in brackets.
Definition
[^] /[^A-KM-Z]ove/ means Love
Term
Which regular expression operator means do forward search for a single-stand-alone digit character in the current file; digits that are part of strings are not identified
Definition
/[0-9]/
Term
Which regular expression operator means Do backward search for words or strings in words that end with .c followed by single digit between 1 and 7
Definition
?\.c[1-7] ?
Term
Which regular expression operator means search the whole file and substitue colon and the end of the line with a period
Definition
:1,$s/:$/./
Term
Which regular expression operator means from the current line to the end of file, substitute the words Hello and hello starting a line with the word Greetings
Definition
:.,$s/^[Hh]ello/Greetings/
Term
Which regular expression operator means eliminate one or more spaces at the beginning of all the lines in the file.
Definition
:1,&s/^ *//
Term
Reduction in the size of a file is known as __
Definition
file compression
Term
Which command is the GNU tool for compressing files
Definition
gzip [options] file-list
Term
Which command is the GNU tool for uncompressing files
Definition
gunzip or gzip -d
Term
Means ordering a set of items according to come criteria
Definition
Sorting
Term
Unix utility to sort items in text (ASCII files)
Definition
sort +1 students
Term
Sort the students file in revers order by using the phone number as sort key and ignoring leading blanks.
Definition
sort +3 -r -b students
Term
Sort the students file with the last name as the primary key and the phone number as the secondary key
Definition
sort +1 -2 +3 -b students, +1 -2 means that the key starts and ends before the e-mail address field (-2) starts
Term
Search the directories in directory-list to locate files that meet the 'criteria' described by the expression (the second argument)
Definition
find directory-list expression
Term
Search for files with inode number 'N'
Definition
find -inum N directory-list
example: find /usr . -inum 258072 -print
Term
Search for files that are specified by the 'pattern'
Definition
find -name pattern
example: find ~ -name Pakistan.gif -print
Term
Command used to locate binaries, source codes, and manual pages for hte command in file-list - a space-seperated list of command names
Definition
whereis [options] file-list
examples: whereis ftp, whereis -b cat
whereis find compress tar
Term
The command used to determine the location (absolute pathname) of the version that is executed by the shell you are using when you type the command
Definition
which 'command'
Term
Search the files in 'file-list' for the given pattern, or expression; if no file-list, take input from standard input
Definition
grep, egrep, fgrep [options] pattern file-list
Term
display the line the students file that contain string 'sarwar'
Definition
egrep sanwar students
Term
Display the lines in the students file with line number that contain the string 'sanwar'
Definition
egrep -n sanwar students
Term
Search for the string 'include' in all the files in the present working directory that end with .c
Definition
egrep -n include *.c
Term
Display the names of files that contain the word Portland in the ~/States directory
Definition
egrep -l Portland ~/States
Term
Display the lines in the students file that start with letters A through H.
Definition
egrep '^[A-H]' students
Term
Display the lines in the students file that contain at least eight consecutive lowercase letters
Definition
egrep '[a-z]\{8\}' students
Term
Display the lines in the students file that contain a word ending starting with the word(string) Ke.
Definition
egrep "\note: \< is used to indicate the start of a word.
Term
Display the lines in the students file that contain words that end with net.
Definition
egrep 'net\>' students
note \> is used to indicate end of a word
Term
Display the lines that contain either Kimberly or Nabeel.
Definition
egrep -n "Kimberly|Nabeel" students
Term
Display the lines in the students file that starts with letter J.
Definition
egrep "^J" students
Term
Command to cut out fields of a table in a file
Definition
cut -flist [-dchar] [-s] file-list
-f list cut fields specified in the list
-d char Use 'char' instead of as field seperator
-s Do not output lines that do not have the delimiter character
Term
Display only the first and last names in the students file
Definition
cut -f1,2 students
Term
Display the first three fields in the students file
Definition
cut -f1-3 students
Term
Command that concatenates files in file-list horizontally. Hence, this command can be used to paste tables in a column.
Definition
paste [options[ file-list
-d list Use 'list' characters as line seprators; is the default character
Term
Use student_address and student_records tables to generate and display a table that has student names, majors and home phone numbers
Definition
paste student_records student addresses | cust -f1-3,7
Term
When a file is encrypted it becomes:
Definition
indecipherable even if access is granted to read it.
Term
Command to encode source-file from binary to ASCII
Definition
uuencode source-file decode-label
Term
Command to decode encoded-file from ASCII to binary
Definition
uudecode [option] encoded-file
Term
Command to encrypt a file
Definition
>gpg --gen-key
>create passphrase
>gpg -e -r passphrase original_file
example: gpg -e -r 'Karina' smallFile
Term
Command to decrypt an encrypted file
Definition
> gpg -d encrypted_file
>passphrase
example gpg -d smallfile.gpg
Term
A process by which a file is converted to a form completely different from its original version
Definition
Encryption
Supporting users have an ad free experience!