Answers of Open Source Operating System
Answers of Open Source Operating System
Login as Guest
1. useradd guest
2. passwd guest
3. Ctrl + alt + f2
4. login as guest
Find The Present directory
1. pwd
Write the / directory structure
1. ls
Write a few commands available in /bin and /sbin directory
2. /sbin (traceroute,netconfig,ifconfig)
1. ls –l /home
1. mkdir /home/guest/test
1. ls –l /home/guest
1. cp /etc/resolv.conf /home/guest/test/
1. mv /home/guest/test /home/guest/testing
1. rm –r /home/guest/testing
1. Ctrl + atl + F3
The location of kernel files in Unix File System is /boot and by looking at the kernel file,
1. when you login in the linux you will find the kernel version on the top of the
screen.
Practical No. 2
Login as root
Open two Text Mode Virtual Consoles and login as guest and root. Switch between different
Use the Text Editor and write a few lines. Save the file on the Desktop
3. vi Yourfilename
1. in “Preference” go to “Font”
2. redhat-config-xfree86
Find out the current run-level and how many daemons are running
1. ps
2. who
3. free(command)
Practical No. 3
3. click in “delete”
Remove the software package for Mozilla Firefox and try to access Internet. Reinstall it again and
3. to install
1. free
environments
Program No. 4
1. ls /home
1. vi /etc/group
3. or
4. cd /home/
5. ls -l
1. touch sidbi
1. ls –l sidbi
1. ls –i sidbi
1. cp sidbi sidbi1
1. ls –i sidbi1
1. mv sidbi sidbi2
1. useradd guest1
2. passwd guest1
Create a new user guest2 with a different group than the group of guest
2. or
3. useradd guest2
4. passwd guest2
5. Go to /etc/passwd and delete the 4th column of the guest2 user’s line and
6. save it
7. go to /etc/group
10. save it
Find, what permissions should the file sidbi have, so that both guest1 and guest2 can write
Program -5
Open Terminal and find out the shell you are using.
1. echo $SHELL
1. Type = sh
2. or
2. read one
3. read two
1. mkdir /home/guest/test1
2. mv /home/guest/test/*.* /home/guest/test1/
1. cp /home/guest/test1 /tmp
Write, the date of Creation/Modification, ownership, group and permissions of test1 directory
1. ls –l /tmp/test1
2. gzip test1.tar
1. gunzip test1.tgz
1. rm test1
1. vi addnewuser
2. if $1
3. then
4. adduser $1
5. fi
Give appropriate permission so that only guest user can run this command
Program -6
1. du /etc
1. hostname
2. domainname
1.top
1.top
1.init 0
1. du /
1.df /
Traceroute to www.google.com and try to find out how many routers are there between your
1. traceroute www.google.com
1. vi grt
3. read one
4. read two
6. then
8. else
10. fi
12. sh grt
Program -7
Create two users guest1 and guest2. guest1 should have his home directory in /users/guest1
1.useradd guest2
2.passwd guest2
5.passwd guest1
7. mkdir /users
8. mv /home/guest1 /users
9.vi /etc/passwd
1.Passwd guest1
Use ssh or telnet to access your friends machine using guest1 and guest2 accounts
Delete the users guest1 and guest2 and remove their home directories.
1.userdel -r guest1
2.userdel –r guest2
1.top
Or
2.free
1.top
1.ps
1.ifconfig
1.ifconfig
1.ping 172.31.1.1
Program -8
1.ifconfig
Or
2.netstat
Use the GUI to configure the IP address of your machine to 255.255.255.0, DNS to
1.net
Use the Text Mode to restore the network configurations back to your original settings. Check
Write a script to take the full backup of the home areas of all the users in /backup directory.
1.mkdir backup
2.vi backfile
5, sh backfile
1.telnet ipaddress
Program -9
Subnet :172.28.0.0/255.255.0.0
Gateway : 172.28.250.254
DNS : 172.28.250.1
Program -10
Write a program and Algorithm to find greatest among three numbers using C.Execute the
same on Linux
1.vi greater.c
2. #include<stdio.h>
Main(){
Int fst,scd,thd;
Scanf(“%d %d %d”,&fst,&scd,&thd);
printf(“\n%d”,scd,”is greater”);
}
Else{
Printf(“\n%d”,thd,”is greater”):
5. ./greater
1.install rpms