0% found this document useful (0 votes)
35 views

Introduction To Linux

The document provides an introduction to Linux including its history from Unix and MINIX, common shells like bash, basic commands for file and directory management, permissions, users and processes.

Uploaded by

RAHUL SHINDE
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)
35 views

Introduction To Linux

The document provides an introduction to Linux including its history from Unix and MINIX, common shells like bash, basic commands for file and directory management, permissions, users and processes.

Uploaded by

RAHUL SHINDE
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/ 28

Introduction to Linux

Ajay Vibhute
History of Linux
• Unix operating system was implemented by Ken Thompson and Dennis
Ritchie in 1969 and first released in 1970

• Then Computer Systems Research Group (CSRG) developed Berkeley


Software Distribution (BSD) in 1977

• In 1983 Richard Stallman started GNU project and wrote kernel called
Hurd

• In 1987 Andrew Tanenbaum developed unix like system for academic use,
MINIX

• In 1991 Linus Torvalds started a project which later became linux kernel.
The development of Linux kernel was done on MINIX using GNU C compiler.
Overview of Linux System
Linux Shells
• Bourne shell: sh

• Korn shell: ksh

• C shell: csh

• Bourne again shell: bash

• tcsh: tcsh
Bash Environment
• /etc/pro le:- system wide default environment
variables.

• ~/.bash_pro le:- user speci c environment


variables

• ~/.bashrc:- called from bash_pro le

• ~/.bash_logout:- executes when users logs out


fi
fi
fi
fi
• who :- shows who all logged in

• who am i:- show the current session

• who -d :- print the dead processes

• who -c :- gives the count of users currently logged in

• uname:- print system information

• uname -a : print all information


Listing the files

• ls :- List all les in current working directory

• ls -a :- List all les in current working directory


including hidden les

• ls -ltrh :- Displays the sorted list of les along with


other information like permissions, links etc.
fi
fi
fi
fi
Creating a Directory

• mkdir <directory name>:- Creates an empty


directory

• mkdir -p <parent directory/sub directory>:- Create


intermediate directories as required.
Change the directory

• cd <directory name>:- Change the directory

• cd - :- Change directory to last working directory


Path of current directory

• pwd : print name of current/working directory


Create Empty file

• touch < lename>

• Open le using gedit and add some text,


gedit < lename> &
fi
fi
fi
View contents of the file

• cat < lename>

• more < lename>

• head -n <no-of-lines> < lename>

• tail -n <no-of-lines> < lename>


fi
fi
fi
fi
Count number of lines in a file

• wc < le-name> :- print the number of newlines,


words, and bytes in les

• wc -l < le-name>:- print the number of lines

• wc -w < le-name>:- print the word count


fi
fi
fi
fi
Determine the file type

• le < le-name>: determines the type of the le


fi
fi
fi
Search pattern in the text file

• grep <pattern> < le-name>

• grep -i <pattern> < le-name> :- Search by ignoring


the case

• grep -v <pattern> < le-name> :- Print the non-


matching lines

• grep -c <pattern> < le-name> :- Print count of


matching lines
fi
fi
fi
fi
Copy and move file

• cp <source- le> <destination- le>

• cp -r <source-directory> <destination-directory>

• mv <old- le-name> <new- le-name>

• mv <old-directory-name> <new-directory-name>
fi
fi
fi
fi
Delete a file

• rm < le-name>: Remove a le

• rm -f < le-name>: Remove le forcefully

• rm -r < le-name>: Remove le recursively


fi
fi
fi
fi
fi
fi
Changing permissions of le

• chmod <permission> < le-name>

7 read, write and execute rwx


6 read and write rw-
5 read and execute r-x
4 read only r--
3 write and execute -wx
2 write only -w-
1 execute only --x
0 none
fi
fi
Changing the owner of le

• chown <user:group> < le-name>

• chown -R <<user:group> < le-name> :Change


owner recursively
fi
fi
fi
Getting size of le

• du < le-name>

• du -h < le-name> : Estimate le size in human


readable form

• du -s : summarise the output


fi
fi
fi
fi
Search a le

• nd -name < le-name> :search for le with given


name

• nd -P <path> -name < le-name>: search for le


name in the speci ed path

• nd -mindepth/-maxdepth: decides the depth of


the search
fi
fi
fi
fi
fi
fi
fi
fi
fi
Sort content of the le

• sort -n : use numerical values to sort

• sort -r : sort in reverse order

• sort -k pos1,pos2 : specify sorting key

fi
Extract columns from tabular
ASCII le

• cut -d delimiter

• awk
fi
Getting available memory

• free :- Shows available memory

• free -m :- Shows available memory in MB

• free -g :- Shows available memory in GB


List running processes

• ps : List processes

• ps -aef :- list all processes running on the system

• kill <signal> <pid>


File compare and
conversion

• diff

• cmp

• od -a

• od -h
Using | (pipe)

You might also like