You are on page 1of 4

Linux Practicals

1.
a) Create a user ‘xyz’, a group ‘g1’ using command. Add user ‘xyz’ to group ‘g1’.
b) Create two directories /data/sales and /data/support. Change the group ownership of
these directories to group ‘g1’.

2. Set up our own repository. Install any rpm from the created repository. Show the output to the
examiner.

3.
a) Write the command to show just the configuration files used by HTTP.
b) Mount and Unmount a USB flash drive using commands.
c) Create a primary partition and an extended partition on your USB flash drive.
d) Format the primary partition with ext4 file system.

4.
a) Write a command to list all the processes currently running on your system and redirect
the output to a text file.
b) use vi editor to perform the following
a. Append a text after the current position of the cursor.
b. Open a new line under the current position of the cursor.
c. Delete a single character.
d. Delete a complete line.
e. Delete from the current position up to the end of the line.

5. Archive the contents of /etc and extract the archived contents to tmp directory.

6. Create a logical volume and format the volume with an ext4 file system.

7. Create a swap space and make a swap file. Show your output to the examiner.

8. Write a command to add secondary ip address to the network card.

9. Use a USB flash drive to demonstrate disk partitioning and format it with ext4 file system.

10. Create two users and change the variable CREATE_HOME in its configuration file and check the
login. Create two groups University and College, add one of the user created in the above
question to the college group.
11.
a) Create four users and add them to two different groups TYIT and College.
b) Grant permissions to these groups such that only the users will be able to write from
these directories others will be denied.
c) Apply advanced permission to group TYIT such that the members of TYIT group are able
to share files in a shared group directory.
d) Use chattr command to show effect of any two attributes.

12.
a) Archive and extract the contents of etc directory.
b) Create your own repository to install any software packages.

13. Use a USB flash drive to demonstrate disk partitioning and format it with ext4 file system.

14.
a) Create a directory with the name /tempdir. Copy all files from the /etc directory that
starts with a, b or c to this directory.
b) Find all files on your server than have a size greater than 100MB.

15. Find all files on your server that have a size greater than 500MB.

16.
a) Create a rule to allow incoming requests to port 80.
b) Encrpyt and Decrpyt a file with gpg.

17.
a) Create a user and change the password expiration policies using commands.
b) Write a script that uses pattern matching to start searching a string.

18. Write a script to create a counter and display the counter.

19.
a) Write a script to apply pattern matching on a date string.
b) Write a script to add two numbers.

20.
a) Write a rule to accept all packets from your client machine.
b) Write a rule to block facebook.com.
c) Insert a firewall rule between 1 and 2 created by accepting packets from Ethernet
interface.
21.
a) Implement a linux server system with an ip address 192.168.0.45 and update the
hostname as ServerXX (XX Stands for rollno).
b) Implement a linux client system with an ip address 192.168.0.24 and update the
hostname as ClientXX (XX Stands for rollno).
c) Restart the basic services essential for any network configurations.
d) Add a normal user and login using any of the server terminal and resume back to the
GNOME terminal.
e) Create a folder with your name and give full access rights to that folder in server.
f) Create a folder with another name and give only read, write access to that folder in
client.
Note: d, e, f to be done using linux commands.
Show each step output to examiner and write the same.

22. Use vi editor and replace text with vi without using insert mode:
i. Single character.
ii. Single String.
iii. Occurrences of a String.

23.
a) Illustrate the steps to the examiner to move a job from foreground to background.
b) Use top command and then change the niceness of the top process priority.
c) Schedule a cron job and send an email message every 5 minutes from normal user
account to root user account.
d) Mount and Unmount a USB flash drive using commands.

24. Create symbolic link and hark link of the file and restore the original file. Show the difference in
removing the symbolic link file and hark link file to the examiner.

25. Configure a firewall rule for SSH and make a log file for the SSH traffic and show the log file
results to the examiner.

26. Create a “Subject expert” script. The script should have the following components.
i. Enter the name of the course.
ii. Use case to test different courses.
iii. Run the scripts as per the courses and the subjects and tell the examiner the output as
per the course the subject to be listed out.
27. Write a script to display the lines of /etc/nsswitch conf file.

28.

a) Create a backup of the /tmp directory in an archive with the name /tmp.tar.
b) Extract the same file in /tmp2 directory.

29. Create a file in your home directory, and fill it all with errors that are generated if you try to
run the command grep –R root * from the /proc directory as an ordinary user.

You might also like