Practical 2
Practical 2
PRACTICAL - 2
$ cal
command is a calendar command in Linux which is used to see the
calendar of a specific month or a whole year.
( shubhdeep@ kali
$ cal
March 2022
su MO Tu we sa
$ cal -y
Shows the calendar of the complete current year with the current date
highlighted.
Name: Anmol Kumar Sec: 5th (D1) Roll no: 11202667
$ date
date command is used to display the system date and time. Date command
is also used to set date and time of the system
$ date -u
-u option displays the time in UTC(Coordinated Universal Time )
$ pwd
pwd stands for Print Working Directory. It prints the path of the working
directory, starting from the root.
$ who
The who command displays information about all users currently on the
local system.
$ uname
The command 'uname' displays the information about the system.
$ uname -a
It prints all the system information.
$ uname -n
It prints the hostname of the network node
The Is is the list command in Linux. It will show the full list or content of
your directory. Just type Is and press the enter key.
Name: Anmol Kumar Sec: 5th (D1) Roll no: 11202667
The tty command of terminal basically prints the file name of the terminal
connected to standard input.
$ bc
bc stands for basic calculator. bc command is used for command line
calculators. It is similar to basic calculator by using which we can do basic
mathematical calculation
$ echo "5+5" | bc
Usage of bc with echo
$ clear
clear is a standard Unix computer operating system command that is used
to clear the terminal screen.
Name: Anmol Kumar Sec: 5th (D1) Roll no: 11202667
$ mkdir
The mkdir stands for 'make directory'. With the help of mkdir command,
you can create a new directory wherever you want in your system
$ rmdir
$mv
Linux mv command is used to move existing file or directory from
one location to another buzdar@ubuntu:-$ Is esktop Documents
Downloads sample. txt snap Test buzdar@ubuntu:-$ Is -
/Documents/ ample. txt buzdar@ubuntu:-$ mv -b sample. txt —
/Documents/ buzdar@ubuntu:-$ Is —/Documents/ ample. txt
sample. txt-
$ cp
'cp' means copy. 'cp' command is used to copy a file or a directory
$ touch command is a way to create empty files. You can update the
modification and access time of each file with the help of touch command.
$ chmod
Linux chmod command is used to change the access permissions of files
and directories. It stands for change mode
The file permissions in Linux are the following three types:
• Read (r) -4
• write (w) - 2
• execute (x) – 1
$ chmod 777 hello.txt
The above command will give permission to everyone to read, write, and
execute the file.
Name: Anmol Kumar Sec: 5th (D1) Roll no: 11202667
$umask