Command with Linux Operation System. Display the complete command that will acco
ID: 3810215 • Letter: C
Question
Command with Linux Operation System.
Display the complete command that will accomplish the following actions. (ie. If you were asked to extract the second column of information from a file called “food” you would display the following: cut –f2 food (NOT just the word cut))
1. Your friend’s computer has an IP address of 10.1.1.10. What command will allow you to poll their computer?
2. What command would you use to get a more detailed view of the users who are currently on your system?
3. What command do you use in order to obtain root privileges and keep them for multiple commands?
4. Create a new user named student1. Use a comment of ECT1030 Student that will appear as the full name of the user when they do a graphical login. Also ensure that their home directory will be created. What single command did you use to accomplish all of this?
5. What command would you use to change the password of student1?
6. Create a new group called Students in the reserved range of GIDs. What command did you use to create this group?
7. What command would you use to obtain information about this new group?
What was the GID of this group?
8. What command would you use to add the Student group as a secondary group for the student1 user?
What command can you use to verify that student1 was added to the Student group?
9. What command would you use to determine the last time that the student1 user logged into the system?
10. What command would you use to delete the student1 user but not their home directory?
Explanation / Answer
1. Your friend’s computer has an IP address of 10.1.1.10. What command will allow you to poll their computer?
ping 10.1.1.10 will check whether the neighbour computer is connected/communicating or not.
2. What command would you use to get a more detailed view of the users who are currently on your system?
who(or w) is the command which will list all the currently logged-in users.
3. What command do you use in order to obtain root privileges and keep them for multiple commands?
sudo is the command to use root privileges to execute a command which cannot be executed
with your existing privileges. Where as if you want to execute multiple commands with root
privileges the two possible options are, either prefixing sudo for every command you execute.
Or just using the command "sudo -i" which will keep you in root privileged mode, so that
you can execute multiple commands till you exit from that mode.
4. Create a new user named student1. Use a comment of ECT1030 Student that will appear as
the full name of the user when they do a graphical login. Also ensure that their home
directory will be created. What single command did you use to accomplish all of this?
useradd will add the new user, where as the -c option will add comments to the user.
So, the syntax is:
useradd -c "ECT1030 Student" student1
5. What command would you use to change the password of student1?
passwd is the command to change the password of a user.
So, the syntax is:
passwd student1