POS 433 Week 4 File processing commands worksheet

POS 433 Week 4 File processing commands worksheet
1. How do you know how many number of users currently logged into the system?
2. Create a file "employees.txt" using vi editor or pico.
3. How do you display the hour and minute from date command using cut utility (1)
4. What is the difference between the following commands? (1)
5. We know that all user information is stored in /etc/passwd where fields are
delimited by a colon. Display only their userids using cut command. (userid is the first
field in /etc/passwd file) Show only top 10 userids. (1)
6. Create the following four files chapter 1, chapter2, chapter3, chapter4 in your
current directory and enter the following text:
Chapter1:
This is the first line in this file
This chapter deals with the basic information of a UNIX system.
Chapter2:
This is the first line in this file
This chapter deals with Unix System info and shell introduction.
Chapter3:
This is the first line in this File System
This chapter deals with various Unix Systems.
Chapter4:
This is the first line in this file
This chapter deals with kernel system.
7. Show these commands and output:
A. Redirect man pages of 'find' command to a file called, find manpages in /tmp
directory.
B. Display lines not having the word "version" in the above file.(1)
(½ is for the command and ½ for the output)
8. Which command of the following is correct? (Some may work but does not make
sense). (1)
9. We know that Is -1 command shows all the files in the current directory. How do
you display only the directories, not files in the current directory. (You have to use is
command, but not find command) (1)
10. How do you set only read permissions to user, group and others in octal mode for
a file "myfile.txt" ? (1)
11. You observed that some of your group members are fiddling with your file
"myfile" and you wanted to remove the read permission to your group. How do you
do? (1)
12. Here is the long listing of a file.
-rw-rw-rw- 2 Y435678 odms 22 Sep 02 12:03 myfile.txt
Is the above a file or a directory? To which group does it belong? (1)
13. Here is another long listing of a file. (1)
-rw-r----- 1 Y435678 odms 20 Sep 02 17:03 file.txt.
What are the owner permissions?
14. The file users_data has the following contents: (1)
15. How do you list only duplicate lines in a file "myfile" (1)
Recommended for you
Reviews & Feedback
Average rating 0.0 based on 0 review(s).
No Reviews Yet.