Question on Search and Sort Tools.
Question Bank
11.1 Which of the following commands are filters:
a. ls
b. ps
c. egrep
d. who
e. find
11.2 Suppose you have a phone file with names and associated phone number in each line. Can you use grep command to locate a friend’s phone number? How?
11.3 List all the files in the current directory with names not exceeding two characters.
11.4 How can we enforce restricting the search to the last 10 lines of the file in the phone file described in 1 above.
11.5 Suppose a system has several user logged on – how will you find if your friend is logged on to the system?
11.6 Suppose there are a large number of users who are logged on to the system. We need to sort the users in the order of their login time. How should we proceed if we only need to know the user who logged on earliest amongst them?
11.7 What is the use of "find" command in UNIX environment? What are the options available with find command and how are the options utilized?
11.8 What is the difference between the find and locate command?
11.9 Write a program to print all the words in a file that occur twice consecutively in the file.
Ex. The world world is not not enough
Output :
---------
world not
11.10 Assume the last file you created yesterday was called last20.
How would you use find command to determine which files you have created today?
Comments
Post a Comment