0% found this document useful (0 votes)
7 views

Shell Scripting Questions

Uploaded by

Deepak Sagar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Shell Scripting Questions

Uploaded by

Deepak Sagar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Advanced-Level Shell Scripting Questions

1. Write a script to count and display the number of lines in a file containing a specific keyword.

2. Write a script to find and delete empty files in a directory.

3. How do you check if a file is a symbolic link and print its target?

4. Write a script to merge multiple .csv files into a single .csv while avoiding duplicate headers.

5. How do you recursively search for a specific word in all text files within a directory?

6. Write a script to monitor disk usage and send an email alert if usage exceeds 80%.

7. Create a script to check if specific processes (e.g., nginx, mysql) are running and restart them if

they are not.

8. Write a script to fetch system uptime and load averages every minute and log them to a file.

9. How do you check CPU usage of a specific process using ps and awk?

10. Write a script to display the five largest files in a directory.

Page 1

You might also like