Top Unix Interview Questions - Part 8
1. Write a command to print the lines that has the the pattern "july" in all the files in a particular directory? grep july * ...
1. Write a command to print the lines that has the the pattern "july" in all the files in a particular directory? grep july * ...
1. Write a command to display your name 100 times. The Yes utility can be used to repeatedly output a line with the specified string or ...
1. Write a command to remove the prefix of the string ending with '/'. The basename utility deletes any prefix ending in /. The u...
1. How to display the processes that were run by your user name ? ps -aef | grep <user_name> 2. Write a command to display all the...
1. How do you write the contents of 3 files into a single file? cat file1 file2 file3 > file 2. How to display the fields in a text f...
1. Display all the files in current directory sorted by size? ls -l | grep '^-' | awk '{print $5,$9}' |sort -n|awk '{p...
1. How do you rename the files in a directory with _new as suffix? ls -lrt|grep '^-'| awk '{print "mv "$9" ...
1. How to display the 10th line of a file? head -10 filename | tail -1 2. How to remove the header from a file? sed -i '1 d' fi...
Find utility is used for searching files using the directory information. 1. Write a command to search for the file 'test' in the...
The cut command is used to used to display selected columns or fields from each line of a file. Cut command works in two modes: Delimite...
SED is a special editor used for modifying files automatically. 1. Write a command to replace the word "bad" with "good...
The grep is one of the powerful tools in unix. Grep stands for "global search for regular expressions and print". The power of gr...
Awk is powerful tool in Unix. Awk is an excellent tool for processing the files which have data arranged in rows and columns format. It is ...