Question: Part 1 Vi ( 1 0 Marks ) 1 . What are the 3 modes of vi ? Explain the role of the modes. 2

Part 1 Vi (10 Marks)
1. What are the 3 modes of vi? Explain the role of the modes.
2. How can you exit vi and save the file at the same time?
3. How can you save a file without exiting vi?
4. How can you turn on line numbering in vi?
5. How is copy and paste and cut and paste performed in vi?
Part 2 Shell scripting (20 marks)
1. File Management Script: Write a shell script called file_management.sh
that performs the following tasks:
Creates a new directory named my_files in the current directory.
Copies all files with a .txt extension from the current directory to the
my_files directory.
Displays a message indicating the total number of files copied.
2. System Information Script: Write a shell script called system_info.sh that
gathers and displays the following system information:
Hostname
Kernel version
CPU information (number of cores, processor type)
Total memory available
Disk usage information (total disk space, used space, available space)
3. Backup Script: Write a shell script called backup.sh that creates a backup
of a specified directory. The script should take the following parameters:
Source directory: the directory to be backed up.
Destination directory: the directory where the backup will be stored.
The script should create a timestamped directory inside the destination
directory and copy all files and subdirectories from the source directory
into it.
Using, gzip, bzip2, or zip, compress the contents of the destination
directory, to a file.
4. Password Generator Script: Write a shell script called
password_generator.sh that generates a random password of a specified
length. The script should take the desired length of the password as a
command-line argument

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!