Linux-Day3-Assignment

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: ps: provides a snapshot of current processes and their status.

ps -eaf: e=> Select all processes. Identical to -A.

a=> Select all processes except both session leaders (see getsid(2)) and processes not associated with a terminal.

f=> display a full-format listing that includes additional details about each process.

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

Ans: find / -size +2M

4. Check if the 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:

6. Check to 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.

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

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

Use grep to list all words matching “boo”

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

List the number of lines that match “boo”

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

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