PrepAway - Latest Free Exam Questions & Answers

What single command would you use?

You want to list a file line by line, but in reverse order. What single command would you use? Give only the command, without any parameters.

PrepAway - Latest Free Exam Questions & Answers

Answer: tac

Explanation:
About tac

Concatenate and print files in reverse.

Syntax

tac [OPTION]… [FILE]…
-b, –before attach the separator before instead of after
-r, –regex interpret the separator as a regular expression
-s, –seperator=STRING use STRING as the separator instead of newline
–help display this help and exit
–version output version information and exit

Example:
tac /var/log/maillog | grep user@domain.com | head -n 10


Leave a Reply