By:-Shreyas Sanjay Deshpande Abhijit Ravindra Chaudhari
By:-Shreyas Sanjay Deshpande Abhijit Ravindra Chaudhari
l
L: Frequent Updates available
W: Updates only once in two years or more.
●
L: works on all processors from ARM to Supercomputers.
W: Limited processors (Domestic and Office).
LINUX vs WINDOWS
●
L: only 48 viruses know
W: new viruses produced daily.
●
L:This is the KERNEL which can be used to developed
RTOS as well as GPOS.
W:It is complete GPOS so we have to use it as is.
Debian Ubuntu
RedHat
Debian
Fedora
Mint
Ubuntu
How to Install
oPrerequisites:
●
20 GB free space(unallocated) EXT4
●
2 GB free space (unallocated) SWAP
●
RAM: >512MB
●
LINUX iso file.
Basic Commands
ls (list)
When you first login, your current working directory is your home directory.
Lists the files present in your CWD
username@hostname:~ $ ls (short for list)
Also try:
LS
ls -a
ls -l
ls -l | more
Basic Commands
pwd (print working directory)
Pathnames enable you to work out where you are in relation to the whole file-system.
For example, to find out the absolute pathname of your home-directory, type cd to get
back to your home-directory and then type
$ pwd
$ mkdir unixstuff
Basic Commands
cd (change directory)
The command cd directory means change the current working directory to 'directory'.
The current working directory may be thought of as the directory you are in, i.e. your
current position in the file-system tree.
To change to the directory you have just made, type
$ cd unixstuff
cat (concatenate)
The command cat can be used to create and display the contents of a
file on the screen.
$ cat > science.txt (to save CTRL + D)
To view the contents of the file
$ cat science.txt
For some fun, try
$ tac science.txt
Basic Commands
vi
VI is an editor for Linux by using which you can create and modify text files.
$ vi test.txt
press “i” for insert mode
enter text
to save and exit : press ESC -> press “:” -> press
“w” and “q”
To view and edit
$ vi test.txt
To exit without saving: press ESC ->press”:”-> press
“q” and “!”
Basic Commands
rm (remove)
To delete (remove) a file, use the rm command. As an example, we
are going to create a copy of the science.txt file then delete it.
Inside your unixstuff directory, type
$ rm science.txt
$ ls (to check if it has deleted the file)
$ cd ..
will take you one directory up the hierarchy (back
to your home directory).
Basic Commands
$ rmdir unixstuff
$ ls (to check if it has deleted the directory)
Basic Commands
clear
To clear the screen
$ clear
cal
To show the month view of calendar
$ cal
Basic Commands
date
To show date and time
$ date
uptime
To find out how long the system is up
$ uptime
Basic Commands
Hostname
Displays the computer name
$ hostname
lshw
Displays the hardware configuration
$ lshw
Basic Commands
ifconfig
To check the network Configuration
$ ifconfig
sudo
Limited user cannot manage packages
but to give temporary rights to the user
for manage packages we use this
command.
Basic Commands
apt-get
This is a utility software which helps to manage the
packages on the computer
$ sudo apt-get update
$ sudo apt-get upgrade
Basic Commands
startx
To load the GUI (x window)
$startx
●
Via downloaded package
●
To install Packet Tracer
●
$ sudo chmod 777 packagename (to get ownership)
●
$ sudo ./packagename
Package Installation
l
LINUX has four types of installation package
●
.rpm
●
$ rpm -ivh packagename
●
.deb
●
$ sudo dpkg -i pakagename
●
.sh
●
$ sudo sh packagename
●
.run
●
$ sudo ./packagename
Compiling a C program
l
LINUX uses a compiler called as GCC(Gnome C Compiler)
l
To write a program we can use either “vim” or “cat” command
l
Let us build our first program for LINUX
●
$ sudo vim
●
press “i” for insert mode
●
#include <stdio.h>
●
#include <stdlib.h>
●
void main ()
●
{
●
printf(“\n JAI HIND \n”);
●
}
Compiling a C program
l
To save the program
●
press ESC → press “:” → type “wq first.c”
●
To Compile
●
$ gcc first.c (a.out file will be created)
●
$ ./a.out (to run the program)
●
To make customized out file
●
$ gcc -o first first.c
●
$ ./first (to run the program)
Any Doubts ??
Thank you