Вы находитесь на странице: 1из 2

Unix Week end test

1. A company named XYZ wants to automate their office and deploy Linux as
operating system. List the various steps involved in the login and logout
phase.
2. Find out present working directory.
3. Create a new directory.
4. Using different manipulating commands move, copy and delete files.
5. Change the access permissions in files and try to access it by the user and
their group members.
6. Create a hard link. Check the inode of both the files. Try to change the
contents of newly created file and save it. Now again check the inode
number. What difference noticed and why?
7. Create a symbolic link. Check the inode of both the files. Do ls -l. What
difference noticed for the files created in 5 and 6?
8. The company XYZ want to save their data in to different files. Illustrate the
steps involved in a)creating a new file ,b) saving it and c) exiting from the
editor.
9. Create a file using cat command. Sort its contents and display it back to the
screen from the command prompt.
10. Using man page find out what who command does and store output of
this command in a file named 'myfile'. Replace the occurrence of the letter
'e' with 'a' in the file and display it into the screen.
11. From the command prompt enter few lines of text. Convert it all in to
uppercase letters store it in a file and display only the first 10 lines.
12. Using tr filter, cut filter and pipes display the filenames in the current
directory along with file size, a screen full at a time.
13. Write a shell script to find out biggest number from given three
numbers. Numbers are supplied as command line argument. Print error if
sufficient arguments are not specified.
14. Write a shell script using case statement to perform basic math
operation as follows:
1. + addition
2. - subtraction
3. x multiplication
4. / division
The name of script must be 'q4' which works as follows:
$ ./q4 20 / 3, Also alias today='date +"%A, %B %-d, %Y"'check for sufficient
command line arguments.

© Amplify Mindware Pvt. Ltd.
15. Write a shell script to see current date, time, user name, and current
directory.

16. Write a shell script called 'sayHello', put this script into the startup file
called .bash_profile, the script should run as soon as the user log on to
system, and it print any one of the following message in info box using dialog
utility, if installed in the system, If dialog utility is not installed then use
echo statement to print message : -
Good Morning
Good Afternoon
Good Evening , according to system time.
17. Write a shell script to convert file names from UPPERCASE to lowercase
file names or vice versa.
18. If you have a file named `#foo.c#' in your directory and you want to
remove it you cannot remove it by typing rm command. why?
19. What is the Linux command to find the PIDs associated with the
controlling terminal?What option is needed to get detailed information?
20. Find the sum of all five-digit numbers (in the range 10000 - 99999)
containing exactly two out of the following set of digits: { 4, 5, 6 }. These
may repeat within the same number, and if so, they count once for each
occurrence.

© Amplify Mindware Pvt. Ltd.

Вам также может понравиться