Linux Assignment– 2
Shell Scripting
Basic Questions
- Create a script to print ‘Hello, World!’.
- Write a script to display the current date and time.
- Create a script to list files in the current directory.
- Write a script to check if a file exists.
- Create a script to read user input and display it.
- Write a script to add two numbers provided by the user.
- Create a script to display system information.
- Write a script to count the number of lines in a file.
- Create a script to display the contents of a file.
- Write a script to rename a file.
- Create a script to delete a file.
- Write a script to create a backup of a file.
- Create a script to display the current user.
- Write a script to check if a directory exists.
- Create a script to create a new directory.
- Write a script to copy a file to another location.
- Create a script to move a file to another location.
- Write a script to display disk usage.
- Create a script to display memory usage.
- Write a script to display the IP address of the system.
Intermediate Questions
- Write a script to find the largest of three numbers.
- Create a script to check if a number is even or odd.
- Write a script to print numbers from 1 to 10 using a loop.
- Create a script to calculate factorial of a number.
- Write a script to check if a string is a palindrome.
- Create a script to reverse a string.
- Write a script to count the number of words in a file.
- Create a script to find all ‘.txt’ files in a directory.
- Write a script to monitor CPU usage.
- Create a script to monitor memory usage.
- Write a script to send an email notification.
- Create a script to archive log files older than 7 days.
- Write a script to automate software installation.
- Create a script to check internet connectivity.
- Write a script to display currently running processes.
- Create a script to kill a process by name.
- Write a script to schedule a task using cron.
- Create a script to log system uptime.
- Write a script to extract lines containing a specific word from a file.
- Create a script to compare two files.
Advanced Questions
- Write a script to monitor disk usage and send alert if usage exceeds 90%.
- Create a script to automate backup of a directory with timestamp.
- Write a script to parse and analyze a log file.
- Create a script to set up a basic firewall configuration.
- Write a script to manage user accounts (add/delete).
- Create a script to automate system updates.
- Write a script to check service status and restart if not running.
- Create a script to generate a system health report.
- Write a script to sync files between two directories.
- Create a script to monitor network traffic and log suspicious activity.