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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!