Skip to content

Latest commit

 

History

History
108 lines (77 loc) · 1.8 KB

Solution.md

File metadata and controls

108 lines (77 loc) · 1.8 KB

Task 4 Solution

  1. Create a new user named newuser.

    sudo useradd newuser
  2. Create a new group named newgroup.

    sudo groupadd newgroup
  3. Add newuser to newgroup.

    sudo usermod -aG newgroup newuser
  4. Check the groups that newuser belongs to.

    groups newuser
  5. Create a directory named task_dir in your home directory

    mkdir ~/task_dir
  6. Change directory to task_dir and create a new file named sample.txt.

    cd ~/task_dir
    touch sample.txt
  7. Change the permissions of sample.txt:

    • Owner: read and write permissions
    • Group: read permissions
    • Others: no permissions
    chmod 640 sample.txt    

    OR

    chmod o=rw,g=r,o= sample.txt
  8. Change the ownership of sample.txt to newuser.

    sudo chown newuser sample.txt
  9. Change the group ownership of sample.txt to newgroup.

    sudo chgrp newgroup sample.txt

    OR

    sudo chown :newgroup sample.txt

    OR

    sudo chown newuser:newgroup sample.txt
  10. Delete the newgroup group.

    sudo groupdel newgroup
  11. Delete the newuser account and its home directory.

    sudo userdel -r newuser
  12. Update the package list on your system.

    sudo apt update
  13. Install the lolcat package.

    sudo apt install lolcat
  14. Print "I Love OSC" by piping the output to lolcat.

    echo "I Love OSC" | lolcat
  15. Remove the lolcat package.

    sudo apt remove lolcat