Q. Which command is used to select those lines where the data lies between 7000 and 7999 at the end of the line of file empl.lit.

  • (A) grep ^7… empl.1st
  • (B) grep “7…$” empl.1st
  • (C) grep “7…^” empl.1st
  • (D) grep “$7…” empl.1st
πŸ’¬ Discuss
βœ… Correct Answer: (B) grep “7…$” empl.1st

Q. Which command is used to select those lines that begin with a 2 in the tre file empl.1st?

  • (A) grep “2^” empl.1st
  • (B) grep “7^” empl.1st
  • (C) grep “2…” empl.1st
  • (D) grep “^2” empl.1st
πŸ’¬ Discuss
βœ… Correct Answer: (D) grep “^2” empl.1st

Q. Which of the following commands is used to update access and modification times of a file?

  • (A) cat
  • (B) touch
  • (C) wc
  • (D) grep
πŸ’¬ Discuss
βœ… Correct Answer: (B) touch

Q. The command that can be used to restrict incoming messages to a user is

  • (A) sleep
  • (B) grep
  • (C) halt
  • (D) mesg
πŸ’¬ Discuss
βœ… Correct Answer: (D) mesg

Q. The command which transcribes the standard input to the standard output and also makes a copy of the same in a file is

  • (A) grep
  • (B) tr
  • (C) sort
  • (D) tee
πŸ’¬ Discuss
βœ… Correct Answer: (B) tr

Q. What command is used to save the standard output in a file, as well as display it on the terminal?

  • (A) more
  • (B) cat
  • (C) grep
  • (D) tee
πŸ’¬ Discuss
βœ… Correct Answer: (D) tee

Q. What command is used to count just the number of lines contained in a file?

  • (A) wc –r
  • (B) wc –w
  • (C) wc –c
  • (D) wc –l
πŸ’¬ Discuss
βœ… Correct Answer: (D) wc –l

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

  • (A) sort
  • (B) sh
  • (C) st
  • (D) sort –r
πŸ’¬ Discuss
βœ… Correct Answer: (D) sort –r

Q. What shell's wild-card is used to match a single character?

  • (A) *
  • (B) ?
  • (C) [ijk]
  • (D) [!ijk]
πŸ’¬ Discuss
βœ… Correct Answer: (B) ?

Q. Which of the following command lists the last 10 lines of a file?

  • (A) tail
  • (B) cat
  • (C) head
  • (D) grep
πŸ’¬ Discuss
βœ… Correct Answer: (A) tail