CMSC 362 Midterm Exam

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/23

encourage image

There's no tags or description

Looks like no tags are added yet.

24 Terms

1
New cards

What file(s) will be displayed by the command cat *ch*?

Both patch and catch

2
New cards

What command sends the word count of the file infile to the newfile?

wc infile >newfile

3
New cards

What command is used to display the directory attributes rather than its contents?

ls -1 -d

4
New cards

What command is used to remove a directory?

rmdir

5
New cards

What command is used to display the top of a file?

head

6
New cards

What command is used to extract specific columns from a file?

cut

7
New cards

What symbol will be used with the grep command to match the pattern ‘pat‘ at the beginning of a line?

^pat

8
New cards

The Octal number to be given along with chmod command to make a file readable, writable and executable to the owner, and readable and executable to group and others is:

755

9
New cards

What command is used to sort the lines of data in a file in reverse order?

sort -r

10
New cards

What command is used to remove the read permission of the file ‘note’ from both the group and others?

chmod go-r note

11
New cards

How can you append the output of a command to a file?

Command » file

12
New cards

What command lets you see what folder you are in?

pwd

13
New cards

What command lets you delete a file named ‘filename’?

rm filename

14
New cards

How do you get all files with an r, g or i in the 3rd position?

ls ??[rgi]*

15
New cards

What command do you have to use to go to the parent directory?

cd ..

16
New cards

With what command can you see your user name?

whoami

17
New cards

What command stops a process?

kill

18
New cards

What does the command ls do?

Displays files and folders present in your current folder

19
New cards

What do you use to forward errors to a file?

2> filename

20
New cards

How can you display a list of all files, including the hidden files?

ls -a

21
New cards

What is the difference between Thread and Process?

A process is a collection of virtual memory space, code, data, and system resources. A thread is code that is to be serially executed within a process.

22
New cards

How will you list only the empty lines in a file (using grep)?

grep "^$" filename.txt

23
New cards

How do you read arguments in a shell program?

$1 would be the first command line argument, $2 the second, and so on; $0 is the name of the script or function.

24
New cards

Which of the following is NOT a proper shell name?

Ssh : Sea shell