0% found this document useful (0 votes)
110 views11 pages

Module 1: Linux Operating System Lab - Level 1

This document provides instructions for a Linux lab involving common Linux commands and tasks. The lab covers: 1) extracting tar and gzip files to a separate directory, 2) comparing files and merging differences, 3) creating aliases for common commands, 4) formatting mount output, 5) explaining awk, grep, and sed, 6) getting system info, 7) remote login, 8) copying files remotely, 9) checking file permissions and changing them, 10) passing a string as an argument and reversing it, 11) asking for a color and repeating if wrong, and 12) double and triple spacing a file.

Uploaded by

der nilam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views11 pages

Module 1: Linux Operating System Lab - Level 1

This document provides instructions for a Linux lab involving common Linux commands and tasks. The lab covers: 1) extracting tar and gzip files to a separate directory, 2) comparing files and merging differences, 3) creating aliases for common commands, 4) formatting mount output, 5) explaining awk, grep, and sed, 6) getting system info, 7) remote login, 8) copying files remotely, 9) checking file permissions and changing them, 10) passing a string as an argument and reversing it, 11) asking for a color and repeating if wrong, and 12) double and triple spacing a file.

Uploaded by

der nilam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Module 1: Linux Operating System

Lab – Level 1

1. Fetch a tar.gz and. tbz file and extract it using tar and gzip command.

2. Extract the above files into a directory and not the same directory where these tar.gz and. tbz files
are present.

3. Show the difference between two files with colored output. Also merge the difference between
two files side by side.
4. Create an alias command for the following:
 listing of directory contents

 listing of directories which are hidden.


Alias nilam=”ls –a /home/nilam”
 to go to previous directory
Alias previous=”cd -”
 to search for any string
 fgrep

 math calculator

 to compare files line by line using diff and display output in color form
5. Make mount command output in human readable format.

6. What is use of following commands? Explain with example.


 Awk
 grep

 sed
7. Get system memory, cpu usage, and cpu memory info quickly.

8. Remote login into your friend's system.

9. After remote login copy a file from your friend's system into your system.
10. WAP that takes a filename as input and checks if it is executable, if not make it executable.

11. WAP to take string as command line argument and reverse it.
12. WAP that asks for the user’s favourite color and if it is not ‘blue’ informs him that it is wrong
answer, waits for 3 secs, clears the screen and asks the question again.
13. WAP that reads each line of a target file, then writes the line back to stdout, but with an extra
blank line following. This has the effect of a double spacing the file. Include all necessary code
whether the script gets the necessary command line argument (a filename), and whether the
specified file exists. When the script runs correctly, modify it to triple-space the target file.
Finally, write a script to remove all blank lines from the target file.

You might also like