This week you will have a chance to practice Linux commands. Please use uisacad5
ID: 3744935 • Letter: T
Question
This week you will have a chance to practice Linux commands. Please use uisacad5 to execute the commands in question 1. You can also use it to test the answers that you write for the other questions. 1. What will be the effect of the following commands? a. who I grep 'root b. ps aux | sort c. date | cut-c12-16 2. Write commands to: a. Find all logged-in users with usernames of at least four characters b. Find all users on your system whose user ids are greater than8. c. Find the number of users on your system whose user ids are greater than 8 d. List al the files in your directory in decreasing order of file size. 3. a. What is the purpose of grep? b. Can grep be used to add, delete or change a line or character in a file? Why? c. Using grep, what is the command to find out if root is currently logged into the system 4. a. What is a command to print every line containing the word UNIX in a file named intro? b. What is a command to print every line containing a number in a file named intro? You can type all the answers in one file and submit in Blackboard. You don't have to create the program files for this assignment.Explanation / Answer
Ans- This command will show Who is logged on as ‘root’ user.
b) ps aux | sort
Ans- returns the full command line of each current process and sort lines of text files
c) date | cut -c12-16
Ans- print or set the system date and time, remove sections from each line of files, select only those characters.
d)ls -l | sort -g -k 5 -r
3. a) Search for PATTERN in each FILE or standard input
c) who | grep 'root'
4.a) grep -i "UNIX" intro
b) grep -i "1" intro
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.