File Processing Commands Worksheet – 15 Marks – Week 4 1. How do you know how many number of users currently logged into the system? (Not considering if any user is logged more than one time) (1) A. who | uniq | sort | wc -l B. who | cut -d' ' –f1 | uniq | wc -l C. who | sort | uniq | wc -l D. who | cut -d' ' –f1 | sort -u | wc -l E. who | cut -d' ' –f1 | uniq -d | wc -l Ans: 2. Create a file “employees.txt” using vi editor or pico. (The file will have 6 fields, ID, Name, Designation, Dept, D.O.B, Salary separated by pipe) Enter these lines in the file and save it. 2133|charles smith |Manager|sales|12/12/56| 90000 9576|Rob Thomson|director |production|03/12/50|130000 5778|David Blake |General Manager|marketing |04/19/43| 85000 2765|Rick Martin|director|personnel |05/11/47|120000 (Use cut command for the following questions A,B) (in each one mark, ½ is for the command and ½ for the output) A. Display the person's name, his designation and salary in the above file. Show the command and output Ans: B: Display first 20 characters on each line in the above file. Show the command and output Ans:
Get Free Quote!
295 Experts Online