Question
2. Launch tmux and split the terminal into two vertical panes. 3. 15pts. Using for loop in CLI : 3.1. In the left pane, process
2. Launch tmux and split the terminal into two vertical panes.
3. 15pts. Using for loop in CLI :
3.1. In the left pane, process the contents of /etc directory to print filemode, filesize, and filename of text files using a for loop, command substitution, and pipes.
a) Use ls -1 /etc when creating the list in the for statement.
b) In the body of the loop, use test command to see if the entry is a file or a directory.Proceed only if it's a file, ignore if it's a directory. Note that you will need to prepend /etc to filename because ls -1 returns only the filename as in ls -l /etc/$_FNAME.
c) Use tr command to squeeze multiple blanks into one blank in each line, like tr -s' ' .
d) Use cut command to select individual fields in an input line.
e) Use tr command again to translate field separator, aka delimiter, blank to a tab as in tr ' ' '\t' .
f) 0pts. Use head command to limit the size of listing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started