lab 4

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

Linux commands and

Shell programing
Cont’d…
• mkdir <directory name>
Exercise
Create directory jijiga_university, under this directory create sub
directory engineering and technology, also under this subdirectory
create another sub directory computer science
ls to view list of directory
Linux commands
1. adduser user name ---------to create user
2. passwd user name ----------to set password
3. delluser user name --------to remove the user
4. mv -t <destination> <filename>-------to move the file or directory
5. rm –d file name--------------to remove file or directory
File permission commands
6. chmod +rw myfile
7. chmod -w filename
8. chmod +x filename
9.Locate filename -----------------to search the file
Reading assignment
• What are the Copy and rename Linux commands ? Apply practically
with examples on your Linux environment
Shell script
#!/bin/bash
If [[ $USER = “root” ]]
then
echo “welcome”
else
echo “bye”
fi
Cont’d…
#!/bin/bash
PASSWORD=“jju”
Echo “enter password”
Read PASS
If [[ $PASS = = $PASSWORD ]];
then
echo “welcome”
else
echo “access is denied”
fi

You might also like