Professional Documents
Culture Documents
Command Function: 1) Study of Basic Linux Commands
Command Function: 1) Study of Basic Linux Commands
Command Function: 1) Study of Basic Linux Commands
Command Function
pwd pwd command is used to find out the path of the
current working directory (folder). The command will
return an absolute (full) path, which is basically a
path of all the directories that starts with a
forward slash (/)
Soln:
OUTPUT:
3) Write a shell script to print a given number in reverse
order and sum of the individual digits.
Soln:
OUTPUT:
4) Write a shell script to accept one integer argument and
print its multiplication table.
Soln:
OUTPUT:
5) Write a Shell Script that makes use of grep to isolate
the line in /etc/passwd that contains your login details.
Soln:
# !/bin/bash
username= whoami
grep "$username:" /etc/passwd
OUTPUT:
6) Using shell script, display the contents of the present
working directory. If it is an ordinary file print its
permission and change the permissions to r--r--r--.
Soln:
OUTPUT: