1) If you are using more to examine a file and decide you want to look back at the previous page what do you enter?
Press the "b" key to move back one screen of text.
2) From more, how can you quickly start editing the current file with vi?
Press the "v" key to enter the Visual Editor.
3) What command tells cut to output the first five characters of every line from the file practice?
Type: cut -f1 practice
4) What command tells grep to look for all lines consisting of only the letter Z followed by any four characters in a file filename?
Type: grep 'Z....' filename
5) What command instructs grep to look through all files in the current directory for lines containing the string Pat Loyd and output just the names of the files containing the match?
Type: grep -l 'Pat Loyd' *
6) How do you get the answer to the following with four figures to the right of the decimal point? Add 424 to 79, divide that sum by 161, then raise that result to the 15th power.
First type: scale=4
Then type: ((424+79)/161)^15
7) What command tells a utility to search through every file in the current directory for the name Catherine Thamzin?
Type: grep 'Catherine Thamzin' * more
8) What command results in a listing of the number of words and the number of lines in the files practice and users_on
Type: wc -wl practice users_on
9) What command creates a new file chapter consisting of the contents of the files section1, section2, section3, and section4, with all the lines numbered?
Type: cat -n section1 section 2 section3 section 4 > chapter
10) A file called empnames contains many employee names, with exactly one name on each line. What command outputs the names in the file in multiple columns, with columns filled before rows?
Type: column empnames more
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment