QUESTION 11 Some programs take a long time to finish when run, so you would like
ID: 3821022 • Letter: Q
Question
QUESTION 11
Some programs take a long time to finish when run, so you would like to run the command in the background so you can continue to work in your terminal until it finishes.
For example, if you are using the "cc" compiler to compile a very complex program that might take an hour to finish compiling, the command might be "cc big-program.c"
How would you run that program and have it run in the background?
top cc big-program.c
cc big-program.c &
%1 cc big-program.c
cc big-program.c !
QUESTION 12
You can type the "ps ax" command to see information about running programs. You want to capture the output of this command to a file named "running-programs.txt". How would you do that?
stdout ps ax running-programs.txt
ps ax | running-programs.txt
ps ax > running-programs.txt
ps ax ; running-programs.txt
QUESTION 13
When using the less command to view a text file, which key can you press to begin a search?
/
s
=
The spacebar
QUESTION 14
Which directory holds most of the system configuration files in Unix?
/etc
/var
/root
/bin
QUESTION 15
What is the difference between "rm *.html" and "rm * .html"? (the second one has a space between the * and the .html)
They both do the same thing.
Both delete every file in the directory that have filenames that end in .html, but the second one will also delete subdirectories.
c.rm *.html will delete all files that have .html as the end of the file name.
rm * .html will delete all files, and also try to delete a file named only .html
d.The first one will work correctly, but the second one is an invalid command.
QUESTION 16
Which command below accomplishes the roughly same task as the following command? ls /usr/bin/*e
ls /usr/bin | grep 'e$'
grep e$ /usr/bin
ls /usr/bin | grep 'e^'
egrep /e/ /usr/bin
QUESTION 17
Which word below is matched by this search?
.grep '^..m.r$'
walker
tamer
amber
d. tomorrow
QUESTION 18
You want to search a file named govern.txt and return all lines that contain either the word COLLINS or the word PINGREE. Which command would work?
grep -E 'COLLINS|PINGREE' govern.txt
cat govern.txt | grep COLLINS | grep PINGREE
grep COLLINS PINGREE < govern.txt
grep ^N$ govern.txt
QUESTION 19
If you have a file named phone-numbers.txt that looks like this:
207-568-6723
617-277-2343
207-822-9645
603-314-5892
800-233-3413
Doing "sort phone-numbers.txt" will end up sorting by area code.
What if you want to sort by the last 4 numbers?
cat -r phone-numbers.txt | sort -rn
sort -t- -k3 phone-numbers.txt
sort -n phone-numbers.txt
sort [[:allnum:]]$ phone-numbers.txt
QUESTION 20
You have a file named employees.txt with content that you want to convert to all uppercase. Which command would do that for you?
tr [:lower:] [:upper:] < employees.txt
sed s/a-z/A-Z/g employees.txt
tr az AZ < employees.txt
grep [a-z] [A-Z] employees.txt
a.top cc big-program.c
b.cc big-program.c &
c.%1 cc big-program.c
d.cc big-program.c !
Explanation / Answer
QUESTION 11
For running longer program:
cc big-program.c &
QUESTION 13:
For searching:
a. /
QUESTION 14:
Most of system configuration files are in:
a. /etc
QUESTION 19:
Sorting numbers:
c. sort -n phone-numbers.txt
QUESTION 20:
lower into uppercase:
a. tr [:lower:] [:upper:] < employees.txt
b.cc big-program.c &
QUESTION 13:
For searching:
a. /
QUESTION 14:
Most of system configuration files are in:
a. /etc
QUESTION 19:
Sorting numbers:
c. sort -n phone-numbers.txt
QUESTION 20:
lower into uppercase:
a. tr [:lower:] [:upper:] < employees.txt
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.