You are on page 1of 6

Tasks:

 Read the file /etc/passwd and notice the different fields. Extract your info
from it.
root:x:0:0:root:/root:/bin/ash
Username : It is used when user logs in. It should be between 1 and 32 characters in length.

: An x character indicates that encrypted password is stored in /etc/shadow file. Please


Password

note that you need to use the passwd command to computes the hash of a password typed at the
CLI or to store/update the hash of the password in /etc/shadow file.
User ID (UID) : Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and

UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by
system for administrative and system accounts/groups.
Group ID (GID) : The primary group ID (stored in /etc/group file)

: The comment field. It allow you to add extra information about the users such
User ID Info (GECOS)

as user’s full name, phone number etc. This field use by finger command.
Home directory : The absolute path to the directory the user will be in when they log in. If this

directory does not exists then users directory becomes /


Command/shell : The absolute path of a command or shell (/bin/bash). Typically, this is a shell.

Please note that it does not have to be a shell. For example, sysadmin can use the nologin shell,
which acts as a replacement shell for the user accounts.
 What is the different between cat and more command
cat command will dump the entire content of a file on the screen whereas more
command will display content that would fit your screen
 What is the difference between rm and rmdir using man?
The rm command can be used to delete non-empty directories as well but rmdir command
is used to delete only empty directories.
 Create the following hierarchy:
o Remove dir11 in one step. What do you notice? And how to overcome
that?

I notice that ‘file1’ also deleted.


o Then remove dir12 using rmdir –p command. State what happened to the
hierarchy (Note: you are in your home dir).
o The output of the command pwd was /home/myuser. Write the absolute
and relative path for the file mycv

o You are in /usr/bin, list four ways to go to your home directory.

 Copy the passwd file to your home directory making its name is mypasswd.
 Rename this new file to be oldpasswd.

 List Linux commands in /usr/bin that start with letter “w”

 Display the first 4 lines of /etc/passwd


 Display the last 7 lines of /etc/passwd

 Display the users who are logged now to the system.

 Display the man pages of passwd the command and the file sequentially in
one command.
 Display the man page of the passwd file.

 Display a list of all the commands that contain the keyword passwd in their
man page

You might also like