0% found this document useful (0 votes)
40 views5 pages

S.No - Page No. Date Signature

This document provides an overview of basic Linux commands for directories, files, permissions, processes, pipes, redirection and more. It also covers the use of wildcards, word counts, disk usage, history and sorting. The document concludes with examples of shell scripts for arithmetic operations, checking values, creating menus and calculating factorials or Fibonacci series.

Uploaded by

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

S.No - Page No. Date Signature

This document provides an overview of basic Linux commands for directories, files, permissions, processes, pipes, redirection and more. It also covers the use of wildcards, word counts, disk usage, history and sorting. The document concludes with examples of shell scripts for arithmetic operations, checking values, creating menus and calculating factorials or Fibonacci series.

Uploaded by

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

S.

No
.
1.

2.

3.

Contents
Basic Commands
Echo
Who am I
Whoami
Who
Clear
Calendar
Date
Uptime
uname
logname
ulimit
dir
Man
Hostname
tty
Directory and Files Command
PWD
Mkdir
Cd
Cd ..
Cat to create file
Cat to view contents of file
Cat to append into file
Cat to create hidden file
Cat to view hidden file
Cat to append into hidden file
Touch
Mv
copy
whatis command
whereis command
rm
rm -i
rmdir
List commands
ls
Ls l

Page No.

Date

Signature

Ls r
Ls -a
Ls -1

4.

Wild Characters
*
?
[-]
[ ,]

5.

Word count
wc filename
wc c
wc w
wc l

6.

Permissions
chmod u+r,g+w,o-x filename
chmod u+r,g-x,o-r filename
chmod u-x,g+r,o+r filename
chmod u+x,g+x,o-w filename
chmod 770 filename
chmod 750 filename
chmod 644 filename
chmod 400 filename
chmod 522 filename
chmod 502 filename

7.

Grep commands
grep pattern filename
grep -c pattern filename
grep -v pattern filename
grep -i pattern filename
grep -n pattern filename

8.

Disk Commands
df
du
free

head filename

9.

10

head n filename
tail filename
tail n filename
history
more
less
cmp file1 file2
sort filename
sort -r filename
file*
file filename
Process commands
ps
ps f
top
fg pid
bg pid
nice
renice
kill
Pipes

cat filename| grep pattern


cat filename | sort -r
ls l |grep pattern
who |ls l
ls l|grep pattern
ls l | grep pattern | sort n
ls|wc l
who|wc
cat filename | wc c

Redirection
cal > filename
date>>filename
ls >filename
sort<filename
sort<filename>filename2
who | ls l >fn4
Tee

ls | tee file
ls |tee fn1 fn2 fn3
ls |tee a fn

11.

Process commands
ps
ps ef
ps a
top
Nice

12.

13.

14.

15.

16.

17.

Shell script to add two numbers


Shell script to subtract two numbers
Shell script to multiply two numbers
Shell script to divide two numbers
To find the largest of two number.
To check whether a number is even or
odd

Shell script to find to check whether the


person is minor, young or old
Shell script to check whether the
entered character is in lowercase,
uppercase, vowel or digit
Write a shell script to create a menu over
given option.
a) List of files
b) Process of user
3) Cal of current month
4) Users of system
Shell script to prepare arithmetic menu
giving 4 choices to user
add
subtract
multiply
divide
Shell script to find the factorial of a
number
Shell script to display Fibonacci
series

You might also like