Search This Blog

Thursday, August 4, 2016

Unix Lab Sheet Queations

UNIX LAB Ex1a. Basic Utilities
Commands to be covered are who,date,cal,tty,bc,clear etc
1.           Print the name of the Present Working Directory?
2.           Print today’s date and time?
3.           Print today’s date and time in different formats?
4.           Print the information about the users?
5.           Create empty files using “touch” utility?
6.           List all the files in current directory?
7.        Perform calculations using cal
8.        Clear the Contents of Screen
9.         Print the calendar for the year 205
10. Print the type of Terminal
Ex1b: File Related Utilities
Commands to be covered are
Cat, cp,mv,rm,cmp,diff,comm.,touch,wc,uniq,head,tail etc
1.Create a file using cat
2.Add Some Contents to existing file
3.Display the contents of the file
4.Copy one file contents to another file
5.Copy one file from one directory to another directory
6.move file from one directory to another directory
7.Compare two files
8.Print the commonalities for given files
 9.Differentiate two files
10.Create empty files using touch
11. Count the number of characters, number of words, and number of lines in file
12.Print first 3 lines in a given file
13.Print last 3 lines in a given file
14. Print non-repeated lines from the given file?
15.Print only the repeated lines from given  file?
16.Print number of occurrences of each line in given file

Exercise 2a Security and File Permissions
Commands to be covered are ls –l,chmod,chgrp,chown,ulimit,umask etc
1.Print long listing of files.
2.chage permissions for given file.
3.Change Owner name for given file.
4.Change group name for given file.
2b:Disk Utilities
Commands to be covered are df,du,mount,unmount,ulimit,finger
  1. Mount a file system.
2.           Un-mount the file system which you have mounted.
3.           Display the boundaries for the different types of variables and memory and sizes.
4.           Display the disk usage in terms of block sizes and trace the most size allocated one.
5.           Set the limit for file

2C  Process Utilities: Commands to be covered are ps,fg,bg,kill
 1.Show the status of running processes
2.Print the background running processes
3.Print the foreground running processes
4.Kill the running process.
Ex 3 Text Processing Utilities:
Commands to be covered are grep,egrep,fgrep,cut,paste,tee etc
1.Display first four characters in a file
2.Display 5-10 character in a file
3.Display first and third field in a file
4.Display only second field in a file
5.join two files
6. Redirect the output into another file
7. Join Two files horizontally
8.Join Two files vertically
9.Search and display all instances of pattern in file
10. Count the number of instances of pattern in file
11. Search in multiple files
12. Display the file name when searching in multiple files
13. Suppress display of file name when searching in multiple files
14. Case-Sensitive search
15. Case-Insensitive search
16. Stop search after certain occurrences
17. Display line number for every match
18. Search for whole word
19.Display N lines after match
20.Display N lines before match 
21.Searching in all files recursively using grep –r
22.Display the lines which does not matches all the given pattern.
23.Display only the file names which matches the given pattern using grep –l
24.Show only the matched string

25.Show the position of match in the line