Lab Assignment_7-Solution (5)
Lab Assignment_7-Solution (5)
Module 1 :
7. Launch a data-intensive task in foreground. Hit ctrl-z key sequence to suspend the process, and
then use bg and fg commands to switch between background and foreground process-running.
Solution.
cat &
fg
Ctrl-Z
fg
8. Look for a runaway processes using top command.
Solution.
top
9. Exit the script.
Solution.
exit
Module 2 :
1. Start script again and append to the existing output file of step 9.
Solution.
script -a lab7
2. Create a new user account with the useradd command.
Solution.
sudo adduser test-user
3. Set and reset a user’s password with the passwd command.
Solution.
sudo passwd test-user
4. Make changes to the created user account with the usermod command.
Solution.
usermod command or modify user is a command in linux that is used to change the properties
of a user in linux through the command line. After creating a user we have to sometimes to
change their attributes like password, login or home directory, …etc. In order to do that we use
the usermod command. The user information of the user is stored in the following files :
e.g.,
sudo usermod -c “This is a test-user” test-user // this will add a comment about the user or a
short description related to the user.
sudo usermod -d /home/test test-user // this will change the home directory of the test-user
sudo usermod -g grouptest test-user // to change the group of the user (e.g., from GroupA to
GroupB)