Lab 3os
Lab 3os
LAB#3
TASL#1 PERFORM ALL LINUX COMMANDS OF LAB3:
Command: date
This command is used to print system date and time.
Command: cal
cal: stands for calendar. It displays the calendar of the current month.
1
OPERATING SYSTEM
Command: cat
It displays the content of the file sequentially with no break.
Example:
o cat > file1
Command: head
It displays the top part/lines of the file. By default it allows 10 lines, but you can change the
settings of the number of lines to be displayed by using –n.
Examples:
o head –n25 file1.txt
This example displays the first 25 lines of the file named “file1.txt”.
Command: tail
2
OPERATING SYSTEM
It displays the last part/lines of the file. By default it allows 10 lines, but you can change the
settings of the number of lines to be displayed by using –n.
Examples:
o tail –n25 file1.txt
Command: ls -l
This command is use to find permission level of the file.
Command: chmod
Each file in UNIX/LINUX has an associated permission level. This allows the user to
prevent others from reading/writing/executing their files or directories.
3
OPERATING SYSTEM
ls > file1
This command put output of ls to file1.
ls >> file1
This command put output of ls at the end of file1.
4
OPERATING SYSTEM
ls < file1
This command put contents to command or shell script from the file.
It takes input to Linux-command from file instead of key-board.
sort file1
This command sorts the contents in the file1.
o cat sort_ names
In above example sort command takes input from “file1” file and output of sort command (i.e.
o tr “ [a-z]” [A-Z] < file1 > cap_ names
o cat cap _ names
5
OPERATING SYSTEM
6
OPERATING SYSTEM
o Open Firefox
o When the download is complete, head to your Files app and click Downloads.
o The Ubuntu Software Center will open. Choose the green Install button.
7
OPERATING SYSTEM
o Enter
your password.
You'll see a notification prompt about the installation being complete. You can access it from
your applications list, and sign into the browser, sync your favorites and other history across
your different operating systems or devices
After that, you'll see that Google Chrome will be available for you in your applications menu.
You'll be able to sign in to your Google account and use the browser just like you would on any
other platform.
You can install eclipse from terminal by typing the following commands:
o Java -version
o sudo apt update && sudo apt install default-jre
o sudo snap install --classic eclipse
o gcc
9
OPERATING SYSTEM
10
OPERATING SYSTEM
11
OPERATING SYSTEM
12