Linux - Day-3 Assignment

·

2 min read

Advanced Linux Commands

  1. List the top 5 used processes running on the system

    Ans: top | head -12

  2. Get details of all processes running on the system. Observe what happens when you put ps -eaf and describe the output here.

    Ans:

  3. Find all the files which are over +2M on your Ubuntu machine

    Ans: find / -size +2M

  4. Check if tree utility is installed. If not, Install the tree utility on your Ubuntu machine.

    Ans:

  5. Download and install Google Chrome on your Ubuntu machine using the terminal. Verify if installation is successful.

    Ans: $ sudo apt update

    Install Wget Utility.

    Download .deb Package.

    Install Google Chrome.

    Launch Chrome through Terminal.

  6. Check Add a crontab entry to log time value(using date command) in a log file op.txt. Run the cron job to execute every 5 minutes. The disk usage on your laptop and log the output to a text file.

    Ans:

  7. Install the network utility nmap on your Ubuntu machine. Verify namp –version and see if it's working.

    Ans:

  8. Using grep, do the following exercise:

    Create a file with the following data. Use vi or cat command –

boot

book

boots

bungie

robot

broken

bark

  1. Use grep to list all words matching “boo”

  2. Use grep to list all words that do not match “boo”

  3. List the number of lines that match “boo”

  4. Use grep to print only the filename that matches the string “boo”

  5. Use sed command to replace the above file where we have boo to woo