Beruflich Dokumente
Kultur Dokumente
PROGRAM NO : DATE :
AIM:
2.
3. Explain the installation procedure of Linux(standalone).
d) cal
e) ls f) mv g)cp h) rm i) rmdir
l) file m) ln n) find
b)diff
b)df
c)dfspace
5. Scheduling commands:a) at
b) batch
c) crontab
8.
9.
e) dd
f) join
g) uniq h) read
c) bc d) factor
e) let f) test
b) head
c) tail
d) tr
e) pg f) more g) less
c) fgrep
d) sed
e) awk
b) talk
c) write
g) who
h) whoami
d) wall
e) finger f) ping
i)hostname j) uname
k) umask
l) chfn
f) dump
b) chown c) chgrp
b) usermod
g)/etc/passwd file
c) userdel
h) /etc/shadow
d) apt-get
Shell Scripts
1. Write a shell script to accept a string and display the same.
2. Write a shell script to check whether an inputted number is odd or even and
display the corresponding message.
3. Write a shell script to find the factorial of a number.
4.
5.
6.
7.
Write a shell script, using case statement to perform basic math operation .
=3000,
DA=11% of BS, HRA=4% of BS and if basic salary <3000, DA=4% of
BS, HRA=10% of BS.Display employee name, basic salary, DA, HRA and Gross salary.
14. Write a program to print all prime numbers from 1 to 300.
(Hint : Use nested loops , break and continue)
15. Write a program to generate all combinations of 1, 2 and 3 using for loops.
16. A file called wordfile consists of several words. Write a shell script which will receive a
list of filenames, the first of which would be wordfile. The shell script should report all
occurrences of each word in wordfile in the rest of the files supplied as arguments.
17.Write a shell script which deletes all lines containing the word unix in the files supplied
as arguments to this shell script.
18. The word unix is present in only some of the files supplied as arguments to the shell
script.Your shell script should search each of these files in turn and stop at the first file that
it encounters containing the word unix . this filename should be displayed on the screen.
19. A shell script receives even numbers of filenames. Suppose four filenames are supplied
then the first file should get copied into second file, the third file should get copied into
fourth file, and so on. If odd number of filenames are supplied then no copying should take
place and an error message should be displayed.
` 20. Write a shell script which displays a list of all files in the current directory to which you
have read, write and execute permissions.
21.Write a shell script which will receive any number of filenames as arguments. The shell
script should check whether every argument supplied is a file or a directory. If it is a directory
it should be appropriately reported. If it is a filename then name of the file as well as the
number of lines present in it should be reported.
22.Write a shell script which will receive any numbers of filenames as arguments. The shell
script should check whether such files already exist. If they do, then it should be reported. If
these files do not exist then check if a sub-directory called mydir exists in the current
directory. If it doesnt exist then it should be created and in it the files supplied as arguments
should get created. If mydir already exists then it should be reported along with the number
of files that are currently present in mydir.