Alien head

Basic Unix Quiz - 1

Description: Basic Unix Quiz - 1
Number of Questions: 10
Created by:
Tags: unix

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



      
  1. ^pat

  2. $pat

  3. pat$

  4. pat^

Answer: 1

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



      
  1. sort

  2. sh

  3. st

  4. sort -r

Answer: 4

Which command is used to display the top of the file?



      
  1. cat

  2. head

  3. more

  4. grep

Answer: 2

Which command is used to copy all files having the string chap and any two characters after that to the progs directory?



      
  1. cp chap?? progs

  2. cp chap* progs

  3. cp chap[12] /progs/.

  4. cp chap?? /progs/*

Answer: 1

Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3?



      
  1. chmod u x emp[l-3]

  2. chmod 777 emp*

  3. chmod u r ??? emp

  4. chmod 222 emp?

Answer: 1

Which command is used to remove a directory?



      
  1. rd

  2. rmdir

  3. dldir

  4. rdir

Answer: 2

Which of the following keys is used to replace a single character with new text?



      
  1. S

  2. s

  3. r

  4. C

Answer: 2

Which command is used to extract specific columns from the file?



      
  1. cat

  2. cut

  3. grep

  4. paste

Answer: 2

Which command sends the word count of the file infile to the newfile.



      
  1. wc infile >newfile

  2. wc newfile

  3. wc infile - newfile

  4. wc infile | newfile

Answer: 1

Which command is used to remove the read permission of the file 'note' from both the group and others?



      
  1. chmod go r note

  2. chmod go rw note

  3. chmod go-x note

  4. chmod go-r, 4-x note

Answer: 4
+ View questions