Assignment-4 Learn to Write Advanced Scripts


1.Create a script that accepts a filename as input and checks if it exists.

2.List the empty files in the current directory.

3.Write a script to copy files from one directory to another.(backup files)

4.Develop a script to delete all files with a specific extension in a directory.(cleaning up)

5..List the name,file size of ordinary files( avoid directories) in the current directory in the descending order of file size.
( Hint:Use tr,grep,tail,cut and sort command)

6.Display the contents of the smallest file( file size is lowest)

7.List the pid(process id), start time and process (command) of all running process.( Hint: use ps –aux command)

8.List the details of the process with process id 1.(Hint use ps command and grep)

9.List the permissions of user and file name of ordinary files in the current directory( avoid directories).

(hint use grep, tr –s,cut –c ,paste. Cut the required fields and store in temporary files.Paste them together using paste.)

10.List the directories only with permissions of user, date and time of creation and directory name in the order of name.

(Hint: use grep,tr,cut, paste,sort)

11.Display the login name and login time of all users along with late time( in minutes).

The script must read the actual time.

( Hint :use w command and cut the login name and time.Convert login time into minutes

and then subtract the actual time to get the late time).

12.count the number of words number of lines and number of characters in a file( use wc command)

13.Disk Usage Monitoring Script( df -u)

14.User Account Creation Script(useradd )

15.Log Monitoring Script(use /var/log/syslog)


Comments

Popular posts from this blog

CSL 204 OPERATING SYSTEM LAB KTU IV SEM CSE

FCFS and SJF

Shared Memory Inter-Process Communication ( IPC)