Name: Nisarg Shah
Registration No: 16MES0057
Worksheet-1
Linux Commands:
COMMAND
cal
cat
SYNTAX
DESCRIPTION
cal
It will display calendar of current month.
cal [year]
It will display calendar of specified year.
cal [month] [year]
It will display calendar of specified
cat [filename]
month in specified year.
It will create a file with specified name if
it is not already exists.
cat [file1name] [file2name]
It will create files with specified names if
they do not already exist.
Cd
cd [directory name]
It is used to go into the specified
cd ..
directory.
It is used to come out from the specified
cd ~
directory.
It is used to come out directly from the
specified
directory
to
the
parent
chgrp
chgrp [group name]
directory.
It is used to change the owning group of
chmod
[filename]
chmod xxx [filename]
file.
It is used to change excess permission of
chown [owner] [filename]
particular file for different user groups.
It is used to change ownership of
clear
clear
specified file.
It will clear the terminal.
cp
date
cp [file1name] [file2name]
date
It will copy the content of file1 into file2.
It will show system date, time and year.
chown
COMMAND
SYNTAX
DESCRIPTION
date +%m
It will show current month number of
date +%h
system.
It will show current month name of
date +%m%h
system.
It will show current month number and
date +%r
name of system both.
It will show current time of system.
diff [file1name] [file2name]
It is used to specify that which lines
echo
echo string
differs in specified two files.
It will print the specified string into the
gedit
gedit [filename]
terminal.
It will open the specified file and if there
diff
is no file with specified name than it will
kill
kill [PID]
create it and then it will open it.
It will kill(stop) the process which
man
man [page no] [..]
specified by PID(process id).
It will help to show detail of manual
mkdir [directory name]
pages.
It will create directory with specified
mv
mv [old filename] [new
name if it is not already exsits.
It is used to rename the specified file
ls
filename]
ls
with new name.
It will list the files present in current
mkdir
directory.
ls x
It will list the files present in current
directory column wise.
ls a
It will list all files present in current
directory including hidden files.
COMMAND
SYNTAX
ls l
DESCRIPTION
It will list the files present in current
directory column with all information
when it is created, its size, file type and
excess permission etc.
ps
ps
It will list current running process with 4
pwd
digit process id(PID).
It will show the path of present working
rm
rm [filename or directory
directory.
It will remove the specified file or
uname
name]
uname a
directory.
It will show all the information like OS
uname n
type, network name and kernel name.
It will show name of network.
uname o
It will show type of OS.
uname s
It will show name of kernel.
uptime
It will show the current time and from
wc [filename]
how long system is turn on.
It will count number of words in
whoami
specified file.
It will show information about current
grep
user.
It searches file for specified words or
head
patterns.
It writes the first ten lines of a file to the
less
less
screen.
This command writes the content ofa file
tail
tail
onto the screen a page at a time.
It writes the last ten lines of a file to the
pwd
uptime
wc
whoami
grep
head
screen.
COMMAND
who
who | grep raju
SYNTAX
DESCRIPTION
who
who | wc-l
To see who is on the system.
To find out how many users are logged
who | grep raju
on.
The output of who command is given as
input to the grep command, so that it will
print if particular user name if he is
sleep 10
logon or nothing is printed.
The command sleep waits a given
bc
number of seconds before continuing.
This command is used for basic
bg
jobs
bg
jobs
calculator.
It runs the process in background.
It will helpful to list the jobs that are
chattr
cmp
chattr
cmp
running in the background.
It is used to change the file attributes.
This command compares two files and
sleep
bc
tells you which line numbers are
cut
host
cut
different.
It is used to cut out selected fields of
host
each line of a file.
This command is used to find the ip
address of the given domain name and
also prints the domain name of the given
free
free
ip.
This command displays the information
about the free and used memory on the
system.