Question: 2. Write a shell script that uses a for loop to add .bac as the extension to the end of each file name that has
2. Write a shell script that uses a for loop to add .bac as the extension to the end of each file name that has a character f at the beginning under current directory. You wont get any credit if dont write a shell script.
Hints:
Use regular expression to represent the group of file names
You can use mv command to change file name.
3. Answer the following questions.
(a) If the output of ps ef command is as follows, write an awk command that will display UID, PID, and COMMAND fields separated by a , and in the order only for the processes created by a user whose user name (UID) starts with f.
$ ps -ef
UID PID PPID TTY STIME COMMAND
fan1234 7236 1 con 22:27:59 /usr/bin/bash
fan1234 11148 7236 con 23:30:34 /usr/bin/ps
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
