Introduction to Linux
DevOps Essentials
2020
@2020 copyright KalKey training
Linux Command Basics
 Linux commands are case-sensitive; ls is not the same as LS
 Linux commands may allow for arguments:
 $ ls /tmp
 You can run more than one command on the same line by separating
the commands with a semicolon (;)
 $ ls;date
 Most Linux commands have a manual page or help to describe how
they can be used in details.
 $ man ls
@2020 copyright KalKey training
Top 50 commands
pwd Print current working directory
ls List the contents of a particular directory and files.
cd Short for Change Directory, the cd command is behind your movement from one directory to another.
mkdir Lets you create folders anywhere you like in your Linux system.
rmdir Remove or delete directory or folder.
lsblk List the available block devices of your Linux system.
mount Mount existing filesystem which are not being used.
df Display essential information about the disk space on your filesystem.
ps Visualize processes currently running on your machine.
kill Kill a stuck process or in some cases used to stop application.
touch Creating a valid empty file.
cat Create new files, view file contents in the terminal, and redirect output to another command-line tool or file.
head View the beginning of a file or piped data directly from the terminal.
cp Copy a file or directory from one folder to another.
mv Move files or directories, same as cut+paste.
comm Compare two files for common and distinct lines.
ln Commands for creating symbolic links to some specific file.
history Print out the bash history of your terminal session
wget Download files from the web right from the terminal.
curl Make request to a web URL. Used for querying web services.
find To search for files based on certain criteria such as file permissions, ownership, modification date, size, etc.
which Search are executable files in the $PATH system environment variable.
echo Lets you output a specific text to the terminal console.
sort Sort out a file in an alphabetical or reverse manner.
sudo Lets non-privileged users access and modify files or to access root from your regular user account.
@2020 copyright KalKey training
Top 50 commands contd...
man Manual or documentation page of a command, when that command is passed as a parameter.
tar The tar command is used for archiving files and extracting them.
printenv Display shell variables.
sleep Pause command execution.
vi/vim Text editor.
wc Print number of lines, words or characters.
diff Compare files line by line.
less Scroll forward or back through a file.
netstat Check connections on server ports (LISTEN/WAIT/ACK/FIN)
chown Change ownership of a file/directory.
awk Allows manipulation of text.
tail View end of the file.
grep Searching for patterns inside large volumes of text files.
sed Commands to manipulate each line of a file or stream by replacing specified parts.
cut Extract a portion of a file using columns and delimiters.
whoami Displays username.
export Export environment variables.
free Check memory usage.
top Monitor CPU, Memory and I/O usage.
rm Delete files.
date Set/ get the system date.
nohup Send process to foreground..
uniq Filtering out the duplicate line in a file.
useradd Create/ add user.
usermod Modify user home directory, shell, groups and other properties.
@2020 copyright KalKey training
Lab 1
1. Display your current directory.
2. Change to the /etc directory.
3. Now change to your home directory using only three key presses.
4. Change to the /boot/grub directory using only eleven key presses.
5. Go to the parent directory of the current directory.
6. Go to the root directory.
7. List the contents of the root directory.
8. List a long listing of the root directory.
9. Stay where you are, and list the contents of /etc.
10. Stay where you are, and list the contents of /bin and /sbin.
11. Stay where you are, and list the contents of ~.
12. List all the files (including hidden files) in your home directory.
13. List the files in /boot in a human readable format.
14. Create a directory testdir in your home directory.
15. Change to the /etc directory, stay here and create a directory newdir in your home
directory.
16. Create in one command the directories ~/dir1/dir2/dir3 (dir3 is a subdirectory
from dir2, and dir2 is a subdirectory from dir1 ).
17. Remove the directory testdir.
@2020 copyright KalKey training
Users and Groups
 Users are associated with a unique user identification (UID) number
that the system uses internally.
 Users can be real people.
 Users can be system entities.
 Users can be herded via groups.
 Groups also are associated with a unique group identification (GID)
number by the system.
 Groups allow multiple users to access/share the same files.
@2020 copyright KalKey training
Ownership & Permissions
 Linux systems are multi user environments that allow users to create
files, run programs and share data.
 Files and directories have two types of ownership the user and group.
A Linux group consists of one or more users.
 Files and directories have three types of access permissions:
a)read permission (r)
b)write permission (w)
c)execute permission (x)
 Every file and directory has permissions for three levels or entities of
permissions:
a)user or owner (denoted by u)
b)group (one or more users denoted by g)
c)others or world (denoted by o)
@2020 copyright KalKey training
Permissions triplets
Each triplet indicates the access permissions for that level – in the example
below,the user/owner has read,write & execute permission,other group
members only have read and execute permissions and all others have no
access permissions.
@2020 copyright KalKey training
Changing Permissions and Ownership
 Use ‘ chmod ’ to change the file:
 chmod [ ugoa ][+/-][ rwx ] filename
 where u=user, g=group, o=others or world and a=all three
 For example, to provide group read access to a file:
 $ chmod g+r myfile
 Or to remove file access to another than the owner or group members
(in other words, others):
 $ chmod o-rwx myfile
 The ‘ chown ’ command is used to change file ownership and the
chgrp ’ command can change group ownership of a file. As a regular
user, you can not change the ownership of a file, but you can change
the group ownership if you are a member of the group to which you
are changing the group ownership.
 You can use the R argument on any of the above to recursively make
changes on a directory of files.
@2020 copyright KalKey training
Lab 2
1)First go to your home directory.
2)Make a ‘LinuxClass’ directory using the mkdir command & go into
that directory.
3)Create 5 empty files in LinuxClass directory.
4)Show permission of newly created files.
5)Add execute permission for group on 2 of the files and make other 3
world readable.
6)Now, remove the execute permission of LinuxClass for all.
7)Change directory to your home directory, then try to see all files under
LinuxClass and then finally go into that directory.
8)Explain what happened and why?
@2020 copyright KalKey training
Simple filter and advance filter commands
 grep–pattern matching search of a file
$ grep cat nonsense.txt
$ grep –i dog nonsense.txt # case insensitive
 uniq–show or remove duplicate lines
$ uniq bears # will show all unique lines
$ uniq –d bears # show only duplicate lines
$ uniq –c bears # show a count of each unique line
 Sorting-read a file, sort the contents and output to the terminal
$ sort –r grades.txt
$ sort -k2 grades.txt
$ sort –bnr–k2 grades.txt
 awk–text manipulation
$ awk ‘{print $1,$5,$3,$4,$2,$6}’
@2020 copyright KalKey training

More Related Content

PPTX
Introduction to linux
PDF
Basics of Linux
PPT
Basic Unix
PPTX
Introduction to linux day1
PPT
1 basic computer operations
PPTX
Basics of-linux
PPT
Unix fundamentals
PDF
Linux Getting Started
Introduction to linux
Basics of Linux
Basic Unix
Introduction to linux day1
1 basic computer operations
Basics of-linux
Unix fundamentals
Linux Getting Started

What's hot (20)

PPT
Linux ppt
PDF
Linux basic
PPTX
Linux basics
PDF
17 Linux Basics #burningkeyboards
PPT
Operating Systems 1
PPT
Operating Systems 2
PDF
Linux practicals T.Y.B.ScIT
PPT
Linux commands and file structure
PPTX
Introduction to linux1
PPTX
Linux fundamentals
PDF
Lesson 1 Linux System Fundamentals
PPTX
Linux basics part 1
PPTX
Basic commands of linux
PPTX
File permission in linux
PPT
Unix file systems 2 in unix internal systems
PPTX
PDF
Quick Guide with Linux Command Line
PPT
06 users groups_and_permissions
PPT
Linux training
PPT
Linux: Basics OF Linux
Linux ppt
Linux basic
Linux basics
17 Linux Basics #burningkeyboards
Operating Systems 1
Operating Systems 2
Linux practicals T.Y.B.ScIT
Linux commands and file structure
Introduction to linux1
Linux fundamentals
Lesson 1 Linux System Fundamentals
Linux basics part 1
Basic commands of linux
File permission in linux
Unix file systems 2 in unix internal systems
Quick Guide with Linux Command Line
06 users groups_and_permissions
Linux training
Linux: Basics OF Linux
Ad

Similar to Linux day 2.ppt (20)

PPTX
Introduction to linux day1
PPTX
Introduction to linux2
PPT
Unix/Linux Basic Commands and Shell Script
PPT
linux-lecture4.ppt
PPT
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
PPT
linux-file-system01.ppt
PDF
Linux OS guide to know, operate. Linux Filesystem, command, users and system
PPTX
18 LINUX OS.pptx Linux command is basic isma
PDF
Programming Embedded linux
PPTX
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
PDF
Solaris basics
PPTX
Linux 4 you
PPT
managing-the-linux-file-system_suse_.ppt
PPT
managing-the-linux-file-system________________________
PPTX
Introduction to linux day-3
PPTX
Unix / Linux Operating System introduction.
PPT
Basic Linux
PPT
Lession1 Linux Preview
PPT
Linux ppt
PPTX
Linux administration training
Introduction to linux day1
Introduction to linux2
Unix/Linux Basic Commands and Shell Script
linux-lecture4.ppt
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
linux-file-system01.ppt
Linux OS guide to know, operate. Linux Filesystem, command, users and system
18 LINUX OS.pptx Linux command is basic isma
Programming Embedded linux
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
Solaris basics
Linux 4 you
managing-the-linux-file-system_suse_.ppt
managing-the-linux-file-system________________________
Introduction to linux day-3
Unix / Linux Operating System introduction.
Basic Linux
Lession1 Linux Preview
Linux ppt
Linux administration training
Ad

More from Kalkey (20)

PPT
Docker swarm
PPTX
Docker advance topic (2)
PPTX
Docker introduction (1)
PPTX
Nexus
PPTX
Sonarqube
PPTX
Introduction of tomcat
PPTX
Jenkins advance topic
PPTX
Jenkins introduction
PPTX
Intro
PPTX
Terraform day 3
PPTX
Terraform day 2
PPTX
Terraform day 1
PPTX
Ansible day 3
PPTX
Cloud computing 1
PPTX
Shell programming 2
PPTX
Adnible day 2.ppt
PPTX
Shell programming 1.ppt
PPTX
Debasihish da final.ppt
PPTX
Linux day 3ppt
PPTX
Ansible day 1.ppt
Docker swarm
Docker advance topic (2)
Docker introduction (1)
Nexus
Sonarqube
Introduction of tomcat
Jenkins advance topic
Jenkins introduction
Intro
Terraform day 3
Terraform day 2
Terraform day 1
Ansible day 3
Cloud computing 1
Shell programming 2
Adnible day 2.ppt
Shell programming 1.ppt
Debasihish da final.ppt
Linux day 3ppt
Ansible day 1.ppt

Recently uploaded (20)

PPT
hsl powerpoint resource goyloveh feb 07.ppt
PPTX
Math 2 Quarter 2 Week 1 Matatag Curriculum
PDF
Health aspects of bilberry: A review on its general benefits
PDF
Unleashing the Potential of the Cultural and creative industries
PPTX
ACFE CERTIFICATION TRAINING ON LAW.pptx
PDF
Review of Related Literature & Studies.pdf
PPTX
Diploma pharmaceutics notes..helps diploma students
PDF
Laparoscopic Imaging Systems at World Laparoscopy Hospital
PPTX
Neurological complocations of systemic disease
DOCX
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
PPTX
Approach to a child with acute kidney injury
PDF
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
PDF
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
PPTX
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
PPTX
IT infrastructure and emerging technologies
PDF
FYJC - Chemistry textbook - standard 11.
PPTX
CHROMIUM & Glucose Tolerance Factor.pptx
PPTX
principlesofmanagementsem1slides-131211060335-phpapp01 (1).ppt
PDF
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
PPTX
growth and developement.pptxweeeeerrgttyyy
hsl powerpoint resource goyloveh feb 07.ppt
Math 2 Quarter 2 Week 1 Matatag Curriculum
Health aspects of bilberry: A review on its general benefits
Unleashing the Potential of the Cultural and creative industries
ACFE CERTIFICATION TRAINING ON LAW.pptx
Review of Related Literature & Studies.pdf
Diploma pharmaceutics notes..helps diploma students
Laparoscopic Imaging Systems at World Laparoscopy Hospital
Neurological complocations of systemic disease
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
Approach to a child with acute kidney injury
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
IT infrastructure and emerging technologies
FYJC - Chemistry textbook - standard 11.
CHROMIUM & Glucose Tolerance Factor.pptx
principlesofmanagementsem1slides-131211060335-phpapp01 (1).ppt
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
growth and developement.pptxweeeeerrgttyyy

Linux day 2.ppt

  • 1. Introduction to Linux DevOps Essentials 2020 @2020 copyright KalKey training
  • 2. Linux Command Basics  Linux commands are case-sensitive; ls is not the same as LS  Linux commands may allow for arguments:  $ ls /tmp  You can run more than one command on the same line by separating the commands with a semicolon (;)  $ ls;date  Most Linux commands have a manual page or help to describe how they can be used in details.  $ man ls @2020 copyright KalKey training
  • 3. Top 50 commands pwd Print current working directory ls List the contents of a particular directory and files. cd Short for Change Directory, the cd command is behind your movement from one directory to another. mkdir Lets you create folders anywhere you like in your Linux system. rmdir Remove or delete directory or folder. lsblk List the available block devices of your Linux system. mount Mount existing filesystem which are not being used. df Display essential information about the disk space on your filesystem. ps Visualize processes currently running on your machine. kill Kill a stuck process or in some cases used to stop application. touch Creating a valid empty file. cat Create new files, view file contents in the terminal, and redirect output to another command-line tool or file. head View the beginning of a file or piped data directly from the terminal. cp Copy a file or directory from one folder to another. mv Move files or directories, same as cut+paste. comm Compare two files for common and distinct lines. ln Commands for creating symbolic links to some specific file. history Print out the bash history of your terminal session wget Download files from the web right from the terminal. curl Make request to a web URL. Used for querying web services. find To search for files based on certain criteria such as file permissions, ownership, modification date, size, etc. which Search are executable files in the $PATH system environment variable. echo Lets you output a specific text to the terminal console. sort Sort out a file in an alphabetical or reverse manner. sudo Lets non-privileged users access and modify files or to access root from your regular user account. @2020 copyright KalKey training
  • 4. Top 50 commands contd... man Manual or documentation page of a command, when that command is passed as a parameter. tar The tar command is used for archiving files and extracting them. printenv Display shell variables. sleep Pause command execution. vi/vim Text editor. wc Print number of lines, words or characters. diff Compare files line by line. less Scroll forward or back through a file. netstat Check connections on server ports (LISTEN/WAIT/ACK/FIN) chown Change ownership of a file/directory. awk Allows manipulation of text. tail View end of the file. grep Searching for patterns inside large volumes of text files. sed Commands to manipulate each line of a file or stream by replacing specified parts. cut Extract a portion of a file using columns and delimiters. whoami Displays username. export Export environment variables. free Check memory usage. top Monitor CPU, Memory and I/O usage. rm Delete files. date Set/ get the system date. nohup Send process to foreground.. uniq Filtering out the duplicate line in a file. useradd Create/ add user. usermod Modify user home directory, shell, groups and other properties. @2020 copyright KalKey training
  • 5. Lab 1 1. Display your current directory. 2. Change to the /etc directory. 3. Now change to your home directory using only three key presses. 4. Change to the /boot/grub directory using only eleven key presses. 5. Go to the parent directory of the current directory. 6. Go to the root directory. 7. List the contents of the root directory. 8. List a long listing of the root directory. 9. Stay where you are, and list the contents of /etc. 10. Stay where you are, and list the contents of /bin and /sbin. 11. Stay where you are, and list the contents of ~. 12. List all the files (including hidden files) in your home directory. 13. List the files in /boot in a human readable format. 14. Create a directory testdir in your home directory. 15. Change to the /etc directory, stay here and create a directory newdir in your home directory. 16. Create in one command the directories ~/dir1/dir2/dir3 (dir3 is a subdirectory from dir2, and dir2 is a subdirectory from dir1 ). 17. Remove the directory testdir. @2020 copyright KalKey training
  • 6. Users and Groups  Users are associated with a unique user identification (UID) number that the system uses internally.  Users can be real people.  Users can be system entities.  Users can be herded via groups.  Groups also are associated with a unique group identification (GID) number by the system.  Groups allow multiple users to access/share the same files. @2020 copyright KalKey training
  • 7. Ownership & Permissions  Linux systems are multi user environments that allow users to create files, run programs and share data.  Files and directories have two types of ownership the user and group. A Linux group consists of one or more users.  Files and directories have three types of access permissions: a)read permission (r) b)write permission (w) c)execute permission (x)  Every file and directory has permissions for three levels or entities of permissions: a)user or owner (denoted by u) b)group (one or more users denoted by g) c)others or world (denoted by o) @2020 copyright KalKey training
  • 8. Permissions triplets Each triplet indicates the access permissions for that level – in the example below,the user/owner has read,write & execute permission,other group members only have read and execute permissions and all others have no access permissions. @2020 copyright KalKey training
  • 9. Changing Permissions and Ownership  Use ‘ chmod ’ to change the file:  chmod [ ugoa ][+/-][ rwx ] filename  where u=user, g=group, o=others or world and a=all three  For example, to provide group read access to a file:  $ chmod g+r myfile  Or to remove file access to another than the owner or group members (in other words, others):  $ chmod o-rwx myfile  The ‘ chown ’ command is used to change file ownership and the chgrp ’ command can change group ownership of a file. As a regular user, you can not change the ownership of a file, but you can change the group ownership if you are a member of the group to which you are changing the group ownership.  You can use the R argument on any of the above to recursively make changes on a directory of files. @2020 copyright KalKey training
  • 10. Lab 2 1)First go to your home directory. 2)Make a ‘LinuxClass’ directory using the mkdir command & go into that directory. 3)Create 5 empty files in LinuxClass directory. 4)Show permission of newly created files. 5)Add execute permission for group on 2 of the files and make other 3 world readable. 6)Now, remove the execute permission of LinuxClass for all. 7)Change directory to your home directory, then try to see all files under LinuxClass and then finally go into that directory. 8)Explain what happened and why? @2020 copyright KalKey training
  • 11. Simple filter and advance filter commands  grep–pattern matching search of a file $ grep cat nonsense.txt $ grep –i dog nonsense.txt # case insensitive  uniq–show or remove duplicate lines $ uniq bears # will show all unique lines $ uniq –d bears # show only duplicate lines $ uniq –c bears # show a count of each unique line  Sorting-read a file, sort the contents and output to the terminal $ sort –r grades.txt $ sort -k2 grades.txt $ sort –bnr–k2 grades.txt  awk–text manipulation $ awk ‘{print $1,$5,$3,$4,$2,$6}’ @2020 copyright KalKey training