SlideShare a Scribd company logo
11-1
Day 2
gdfdgdfdh
fhfjdfhjgfh
gfgjdfhgjd
hffkkfjgkfj
11-2
Working with Basic Commands
history- prints all the previously typed commands
who – prints the name of all users who have currently logged in
who am i- prints the name and details of the current user
whoami- prints the name of the current user
w- prints full information of all the users who have currently logged in
11-3
Working with Basic Commands
free-prints the size and usage of the ram and virtual memory
du- Summarize the disk usage of each file, recursively for directories
Options:
-s –displays only the total sum for the each specified file/directory
-h –displays in human readable format
df- displays free disk space available for each mount we have
Options:
-h –displays in human readable format
-i –list of inode information
-a –includes dummy file system
11-4
Working with Basic Commands
stat –displays file system/file status
tree — lists the contents of directories in a tree like format
Options:
-a – all files including hidden files are printed.
-d – list of directories only
-f – prints the full path prefix for each file
-u – print the username along with the tree
-s – size of the file
exit – allows to exit from program, shell or come out of a linux network
logout – just to come out of a linux network
11-5
Getting Help on Commands
help – it provides information about the command including options but not
elaborately
syn: <command_name> --help
whatis – it provides the information about the command with out the sub
commands(options)
syn: whatis <commad_name>
info –it provides the information of all the commands
man --manual, providing all information of the command
syn: man <command_name>
11-6
Getting Help on Commands
Contd…
whereis –locates a binary,source,and manual page for a command
syn: whereis <comman_name>
which – locate a command
syn: which <command_name>
11-7
File Permissions
Permissions – In Linux, each and every file/directory will have permissions.
we have three different kind of permissions for each file/dir.
- read -r
- write -w
-execute -x
- no permission - -
- These permissions are having the numerical values assigned like:
read – 4 write – 2 execute – 1 no permission - 0
- We have three different kinds of users for each file/dir and each user will
have three different permissions
- owner -u
- group -g
-others -o
owner –means who created the file.
group – means no. of users belongs to that group
11-8
File Permissions
To change the file permissions or changing the ownership and groups of file/dir.
We use the following commands:
chmod – To change the file/dir permissions
chown – To change the file/dir ownership
chgrp – To change the file/dir group.
- To know the permissions of a file/dir use the command : ls –l
In the o/p of ls –l command first column will have the permissions
information.
11-9
File Permissions
chmod – To Change the file/dir permissions using the abbreviations..
syn: chmod [options] <perms> <file/dir>
- To add write permissions to the group
chmod g+w file1 ( + is to add the permissions )
- To add read and execute permissions to the others
chmod o+rx file1
- To remove the write permissions for group and others
chmod go-w file1 ( - is to remove the permissions )
- To add execute permissions to all the users and remove the write
permissions to others
chmod ugo+x,o-w file1
Options –
-R - This option will be used to when you are changing permissions to
directories to recursively apply permissions all the files/subdir in the dir.
chmod –R g+w dir1
11-10
File Permissions
- To change the file/dir permissions based on the numerical values.
- Each user will have all the three kinds of permissions read, write, execute
order, like rwx. For example, if anybody don’t have specific permission it
contains – in that place… like r-x, means no write permissions.
- To calculate the numerical value of the each kind user’s take the some of
their permissions numerical values….
- For example, file1 contains the permissions like : rw-r-xr—
For owner – 4+2+0 – 6
For Group - 4+0+1 – 5
For Others – 4+0+0 - 4
So existing permissions for file 1 is 654
- To Change the file permissions to the like : rwxrw-r-x ; numerical value is
765
chmod 765 file1.
- Using –R options same thing can be applicable for even directories also.
11-11
File Permissions
- if you want to have the same file permissions what other file is having.
chmod --reference file1 file2
- whatever the file1 permissions you will get same as the file2.
- This chmod command can be executed to change the file/directory
permissions only by administrator or owner of the file.. No other users will
have the permissions to change even if they have the write permissions to do
that.
- Maximum permission what we can set is 777 and minimum permissions can
set is 000
Permission Value
--- 0
--x 1
-w- 2
-wx 3
r-- 4
r-x 5
rw- 6
rwx 7
11-12
File Permissions
chown - To Change the ownership of file/dir permissions
chown user2 file1
-To change ownership of file1 as user2
chown –R user2 dir1 ( For directories )
chgrp – To Change the group of file/dir permissions
chgrp grp2 file1
-To change group of file1 as grp2
chown –R grp2 dir1 ( For directories )
-To Change the ownership and group of a file or directory at a time
chown <new username>:<new grpname> file/dir
chown user2:grp2 file1
- Only admin can execute these two commands, no other user cannot
execute these commands.
11-13
Run Levels
- Running the system in different states.
We have totally 7 run levels
0 - Shutdown
1 - Single User Mode ( no networking only root can login, if it is physical)
2 - Mutiluser mode + few networking services
3 - Mutiluser mode + all networking services
4 - Not Used ( But operating as 3)
5 - Runlevel 3 + GUI ( GUI will be available only on runlevel)
6 - Reboot
- How to switch each run level
init <run level>
init 0
init 1
11-14
Run Levels
-Each run level will have an associated directory with list of services
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
-If you go into the directories some of the files(services) will be starting with "S"
and some will be starting with "K"
-if any file/service started with the S -- that service will run in that run level
if any file/service started with the K -- that service will stop in that run level
11-15
Run Levels
-All these run level files/services are linked files to the /etc/init.d files.
-/etc/init.d directory contains all the services which are available/provided by the
redhat by default.
-Run level services will start/stop the respective services automatically.
-if you want to stop/start/status of any service there are two ways:
service <servicename> start/stop/status/restart
-How to change default init level:
syn: id:<init_level>:initdefault:
Ex: id:3:initdefault:
11-16
How to shutdown and reboot the machine
--For Shut downing
halt
shutdown
poweroff
init 0
-- For restarting/rebooting
reboot
shutdown -r
init 6
--shutdown -y now ( Shut down will start immediately)
--shutdown -y 1 ( Shut down will start in 1 min)
--shutdown -y 5 ( Shut down will start in 5 mins)
11-17

More Related Content

What's hot

Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
MohanKumar Palanichamy
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
SuKyeong Jang
 
Linux commands
Linux commandsLinux commands
Linux commands
Radheshyam Kori
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
MAGNA COLLEGE OF ENGINEERING
 
Basic Linux day 6
Basic Linux day 6Basic Linux day 6
Basic Linux day 6
Saikumar Daram
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
atozknowledge .com
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
Hanan Nmr
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
meashi
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
Bonnie Ng
 
Linux commands
Linux commandsLinux commands
Linux commands
Meenu Chopra
 
Basic commands
Basic commandsBasic commands
Basic commands
ambilivava
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
Rodrigo Maia
 
Linux commands
Linux commandsLinux commands
Linux commands
penetration Tester
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
Wave Digitech
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
shravan saini
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
abclearnn
 

What's hot (20)

Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Basic Linux day 6
Basic Linux day 6Basic Linux day 6
Basic Linux day 6
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic commands
Basic commandsBasic commands
Basic commands
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUX
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 

Similar to Basic Linux day 2

Basic Linux
Basic LinuxBasic Linux
Basic Linux
Tan Huynh Cong
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Preview
leminhvuong
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODE
Vpmv
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
Ashwin Pawar
 
18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma
perweeng31
 
Linux ppt
Linux pptLinux ppt
Linux ppt
Sanmuga Nathan
 
Linux ppt
Linux pptLinux ppt
Linux ppt
Rohit Kumar
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheet
We Ihaveapc
 
UNIX Drive Storage
UNIX Drive StorageUNIX Drive Storage
UNIX Drive Storage
adil raja
 
04-1-Linux.ppt
04-1-Linux.ppt04-1-Linux.ppt
04-1-Linux.ppt
EidTahir
 
File permissions
File permissionsFile permissions
File permissions
Varnnit Jain
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
Teja Bheemanapally
 
Rhel1
Rhel1Rhel1
Learning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptxLearning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptx
Shashwat Shriparv
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
Muhammad Qazi
 
File Access Permission
File Access PermissionFile Access Permission
File Access Permission
BIT DURG
 
Unix Basics Commands
Unix Basics CommandsUnix Basics Commands
Unix Basics Commands
Sameeran Jenna
 
Linux day 1
Linux day 1Linux day 1
Linux day 1
sumairdotcom
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
thakor bharati
 
Common linux ubuntu commands overview
Common linux  ubuntu commands overviewCommon linux  ubuntu commands overview
Common linux ubuntu commands overview
Ameer Sameer
 

Similar to Basic Linux day 2 (20)

Basic Linux
Basic LinuxBasic Linux
Basic Linux
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Preview
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODE
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheet
 
UNIX Drive Storage
UNIX Drive StorageUNIX Drive Storage
UNIX Drive Storage
 
04-1-Linux.ppt
04-1-Linux.ppt04-1-Linux.ppt
04-1-Linux.ppt
 
File permissions
File permissionsFile permissions
File permissions
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Rhel1
Rhel1Rhel1
Rhel1
 
Learning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptxLearning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptx
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
File Access Permission
File Access PermissionFile Access Permission
File Access Permission
 
Unix Basics Commands
Unix Basics CommandsUnix Basics Commands
Unix Basics Commands
 
Linux day 1
Linux day 1Linux day 1
Linux day 1
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
 
Common linux ubuntu commands overview
Common linux  ubuntu commands overviewCommon linux  ubuntu commands overview
Common linux ubuntu commands overview
 

Recently uploaded

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 

Recently uploaded (20)

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 

Basic Linux day 2

  • 2. 11-2 Working with Basic Commands history- prints all the previously typed commands who – prints the name of all users who have currently logged in who am i- prints the name and details of the current user whoami- prints the name of the current user w- prints full information of all the users who have currently logged in
  • 3. 11-3 Working with Basic Commands free-prints the size and usage of the ram and virtual memory du- Summarize the disk usage of each file, recursively for directories Options: -s –displays only the total sum for the each specified file/directory -h –displays in human readable format df- displays free disk space available for each mount we have Options: -h –displays in human readable format -i –list of inode information -a –includes dummy file system
  • 4. 11-4 Working with Basic Commands stat –displays file system/file status tree — lists the contents of directories in a tree like format Options: -a – all files including hidden files are printed. -d – list of directories only -f – prints the full path prefix for each file -u – print the username along with the tree -s – size of the file exit – allows to exit from program, shell or come out of a linux network logout – just to come out of a linux network
  • 5. 11-5 Getting Help on Commands help – it provides information about the command including options but not elaborately syn: <command_name> --help whatis – it provides the information about the command with out the sub commands(options) syn: whatis <commad_name> info –it provides the information of all the commands man --manual, providing all information of the command syn: man <command_name>
  • 6. 11-6 Getting Help on Commands Contd… whereis –locates a binary,source,and manual page for a command syn: whereis <comman_name> which – locate a command syn: which <command_name>
  • 7. 11-7 File Permissions Permissions – In Linux, each and every file/directory will have permissions. we have three different kind of permissions for each file/dir. - read -r - write -w -execute -x - no permission - - - These permissions are having the numerical values assigned like: read – 4 write – 2 execute – 1 no permission - 0 - We have three different kinds of users for each file/dir and each user will have three different permissions - owner -u - group -g -others -o owner –means who created the file. group – means no. of users belongs to that group
  • 8. 11-8 File Permissions To change the file permissions or changing the ownership and groups of file/dir. We use the following commands: chmod – To change the file/dir permissions chown – To change the file/dir ownership chgrp – To change the file/dir group. - To know the permissions of a file/dir use the command : ls –l In the o/p of ls –l command first column will have the permissions information.
  • 9. 11-9 File Permissions chmod – To Change the file/dir permissions using the abbreviations.. syn: chmod [options] <perms> <file/dir> - To add write permissions to the group chmod g+w file1 ( + is to add the permissions ) - To add read and execute permissions to the others chmod o+rx file1 - To remove the write permissions for group and others chmod go-w file1 ( - is to remove the permissions ) - To add execute permissions to all the users and remove the write permissions to others chmod ugo+x,o-w file1 Options – -R - This option will be used to when you are changing permissions to directories to recursively apply permissions all the files/subdir in the dir. chmod –R g+w dir1
  • 10. 11-10 File Permissions - To change the file/dir permissions based on the numerical values. - Each user will have all the three kinds of permissions read, write, execute order, like rwx. For example, if anybody don’t have specific permission it contains – in that place… like r-x, means no write permissions. - To calculate the numerical value of the each kind user’s take the some of their permissions numerical values…. - For example, file1 contains the permissions like : rw-r-xr— For owner – 4+2+0 – 6 For Group - 4+0+1 – 5 For Others – 4+0+0 - 4 So existing permissions for file 1 is 654 - To Change the file permissions to the like : rwxrw-r-x ; numerical value is 765 chmod 765 file1. - Using –R options same thing can be applicable for even directories also.
  • 11. 11-11 File Permissions - if you want to have the same file permissions what other file is having. chmod --reference file1 file2 - whatever the file1 permissions you will get same as the file2. - This chmod command can be executed to change the file/directory permissions only by administrator or owner of the file.. No other users will have the permissions to change even if they have the write permissions to do that. - Maximum permission what we can set is 777 and minimum permissions can set is 000 Permission Value --- 0 --x 1 -w- 2 -wx 3 r-- 4 r-x 5 rw- 6 rwx 7
  • 12. 11-12 File Permissions chown - To Change the ownership of file/dir permissions chown user2 file1 -To change ownership of file1 as user2 chown –R user2 dir1 ( For directories ) chgrp – To Change the group of file/dir permissions chgrp grp2 file1 -To change group of file1 as grp2 chown –R grp2 dir1 ( For directories ) -To Change the ownership and group of a file or directory at a time chown <new username>:<new grpname> file/dir chown user2:grp2 file1 - Only admin can execute these two commands, no other user cannot execute these commands.
  • 13. 11-13 Run Levels - Running the system in different states. We have totally 7 run levels 0 - Shutdown 1 - Single User Mode ( no networking only root can login, if it is physical) 2 - Mutiluser mode + few networking services 3 - Mutiluser mode + all networking services 4 - Not Used ( But operating as 3) 5 - Runlevel 3 + GUI ( GUI will be available only on runlevel) 6 - Reboot - How to switch each run level init <run level> init 0 init 1
  • 14. 11-14 Run Levels -Each run level will have an associated directory with list of services /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d -If you go into the directories some of the files(services) will be starting with "S" and some will be starting with "K" -if any file/service started with the S -- that service will run in that run level if any file/service started with the K -- that service will stop in that run level
  • 15. 11-15 Run Levels -All these run level files/services are linked files to the /etc/init.d files. -/etc/init.d directory contains all the services which are available/provided by the redhat by default. -Run level services will start/stop the respective services automatically. -if you want to stop/start/status of any service there are two ways: service <servicename> start/stop/status/restart -How to change default init level: syn: id:<init_level>:initdefault: Ex: id:3:initdefault:
  • 16. 11-16 How to shutdown and reboot the machine --For Shut downing halt shutdown poweroff init 0 -- For restarting/rebooting reboot shutdown -r init 6 --shutdown -y now ( Shut down will start immediately) --shutdown -y 1 ( Shut down will start in 1 min) --shutdown -y 5 ( Shut down will start in 5 mins)
  • 17. 11-17