$()
The bash shell allows you to use
command substitution, which means you can run a command and have its output pasted back on the command line as an argument for another command. Essentially, command substitution allows you to perform multiple tasks at once.
tail $(fgrep –l 192.168 /etc/* )
First, the fgrep –l command is run to search through all the files in the /etc directory for the text string “192.168”. Using the –l option with fgrep causes the command to return a list of filenames only, not the actual matching text.
This list of files is then piped to the tail command, which then displays the last few lines of each file it receives.
LX0-104 Exam Objectives (F)
No comments:
Post a Comment