SlideShare a Scribd company logo
LINUX BASICS
#burningkeyboards
@denis_ristic
LINUX BASICS
WHAT IS LINUX?
‣ An operating system is software that manages all of the hardware resources associated with your desktop or laptop.
‣ The OS is comprised of a number of pieces:
‣ The Bootloader: The software that manages the boot process of your computer. For most users, this will simply be a
splash screen that pops up and eventually goes away to boot into the operating system.
‣ The kernel: This is the one piece of the whole that is actually called “Linux”. The kernel is the core of the system and
manages the CPU, memory, and peripheral devices. The kernel is the “lowest” level of the OS.
‣ Daemons: These are background services (printing, sound, scheduling, etc) that either start up during boot, or after
you log into the desktop.
‣ The Shell: This is a command process that allows you to control the computer via commands typed into a text
interface.
‣ Graphical Server: This is the sub-system that displays the graphics on your monitor. It is commonly referred to as the
X server or just “X”.
‣ Desktop Environment: This is the piece of the puzzle that the users actually interact with. There are many desktop
environments to choose from (Unity, GNOME, Cinnamon, Enlightenment, KDE, XFCE, etc). Each desktop
environment includes built-in applications (such as file managers, configuration tools, web browsers, games, etc).
‣ Applications: Desktop environments do not offer the full array of apps. Just like Windows and Mac, Linux offers
thousands upon thousands of high-quality software titles that can be easily found and installed.
2
LINUX BASICS
DIRECTORY STRUCTURE
3
LINUX BASICS
FILE SYSTEM
‣ "On a UNIX system, everything is a file; if something is not a file, it is a
process."
‣ This statement is true because there are special files that are more than
just files (named pipes and sockets, for instance), but to keep things
simple, saying that everything is a file is an acceptable generalization.
‣ A Linux system makes no difference between a file and a directory,
since a directory is just a file containing names of other files.
‣ Programs, services, texts, images, and so forth, are all files. Input and
output devices, and generally all devices, are considered to be files,
according to the system.
4
LINUX BASICS
FILE SYSTEM
dristic @ MACBOOK [~] ➜ ls -la
total 13936
drwxr-xr-x+ 88 dristic staff 2992 12 Srp 21:02 .
drwxr-xr-x 6 dristic staff 204 3 Ožu 12:26 ..
-rw-r--r-- 1 dristic staff 266 2 Svi 2016 .499481.padl
drwxr-xr-x 3 dristic staff 102 9 Stu 2016 AndroidStudio2.0
‣ - Regular file
‣ d Directory
‣ l Link
‣ c Special file
‣ s Socket
‣ p Named pipe
‣ b Block device
5
LINUX BASICS
SPECIAL FILES
‣ ~/.profile is the shell startup file; .profile will get executed whenever
you login. It is used to set environment variables, aliases and shell
options such as $PATH
‣ ~/.ssh/config is the SSH client configuration file.
‣ ~/.history is a file that contains history of executed commands
6
LINUX BASICS
BASIC COMMANDS
‣ awk Pattern-directed scanning and processing language
‣ cat Display file’s contents to the standard output device
‣ cd Change to directory.
‣ chkconfig Turn on or off services on boot time.
‣ chmod Change a file’s permissions.
‣ chown Change who owns a file.
‣ clear Clear a command line screen/window for a fresh start.
‣ cp Copy files and directories.
‣ date Display or set the system date and time.
‣ df Display used and available disk space.
‣ du Show how much space each file takes up.
7
LINUX BASICS
BASIC COMMANDS
‣ file Determine what type of data is within a file.
‣ find Search for files matching a provided pattern.
‣ grep Search files or output for a particular pattern.
‣ kill Stop a process. If the process refuses to stop, use kill -9 pid.
‣ less View the contents of a file one page at a time.
‣ ln Create a shortcut.
‣ locate Search a copy of your filesystem for the specified filename.
‣ ls List directory contents.
‣ man Display the help information for the specified command.
‣ mkdir Create a new directory.
8
LINUX BASICS
BASIC COMMANDS
‣ mv Rename or move file(s) or directories.
‣ passwd Change the password or allow (for the system administrator) to change any
password.
‣ ps Display a snapshot of the currently running processes.
‣ pwd Display the pathname for the current directory.
‣ rm Remove (delete) file(s) and/or directories.
‣ rmdir Delete empty directories.
‣ sed Short for "stream editor", allows you to filter and transform text.
‣ service Stop, start, restart or find the status of system services.
‣ ssh Remotely log in to another Linux machine, over the network.
‣ su Switch to another user account.
9
LINUX BASICS
BASIC COMMANDS
‣ tail Display the last n lines of a file (the default is 10).
‣ tar Store and extract files from a tarfile (.tar) or tarball (.tar.gz or .tgz).
‣ top Displays the resources being used on your system.
‣ touch filename Create an empty file with the specified name.
‣ wc Word, line, character, and byte count
‣ who Display who is logged on.
‣ stat The stat utility displays information about the file pointed to by file.
‣ id Returns current user identity
‣ crontab Maintains crontab files for individual users
‣ nohup Invoke a utility immune to hangups
10
LINUX BASICS
BASIC COMMANDS
‣ netstat Show network status
‣ ping send ICMP ECHO_REQUEST packets to network hosts
‣ telnet user interface to the TELNET protocol
‣ dig DNS lookup utility
‣ traceroute print the route packets take to network host
‣ vi a programmers text editor
‣ nano editor, an enhanced free Pico clone
‣ apt-get is the command-line tool for handling packages
‣ yum is an interactive, rpm based, package manager
‣ dpkg is a tool to install, build, remove and manage Debian packages.
11
LINUX BASICS
CD EXPLAINED
‣ cd Returns you to your login directory
‣ cd ~ Also returns you to your login directory
‣ cd / Takes you to the entire system's root directory
‣ cd /root Takes you to the home directory of the root
‣ cd /home Takes you to the home directory, where user login directories are usually
stored
‣ cd .. Moves you up one directory
‣ cd /dir1/subdir This absolute path takes you directly to subdir, a subdirectory
of dir1
‣ cd ../../dir3/dir2 This relative path takes you up two directories, then to dir3,
then to the dir2 directory
12
LINUX BASICS
CHMOD EXPLAINED
chmod <people><+/-><permissions>
Example: chmod o-w (deny others from editing the file)
Example: chmod u+rwx (give the owner full control)
r - Read
w - Write
x - Execute
u - The owner of the file
g - The group that the file belongs to
o - Anybody who is not one of the above
a - All users
+ - Add permissions
- - Remove permissions
: 1st octet represents permissions for the owner.
r w x T : 2nd octet represents permissions for the group.
Owner: 4 2 1 7 : 3rd octet represents permissions for everyone else
Group: 0 0 0 0 : For each octet, start at 0 and:
Other: 0 0 0 0 : +4 for read permission.
: +2 for write permission.
Command: chmod 700 : +1 for execute permission.
13
LINUX BASICS
CRONTAB EXPLAINED
crontab -e
# Minute Hour Day of Month Month Day of Week Command
# (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat)
0 2 12 * * /usr/bin/find
14
LINUX BASICS
PIPING AND REDIRECTION
ls | head -3 | tail -1
echo “Hello World!” > file.txt
echo “Hello World!” >> file.txt
wc -l < file.txt
ls -l video.mpg blah.foo 2> errors.txt
ls -l video.mpg blah.foo > myoutput 2>&1
ls | head -3 | tail -1 > myoutput
15
LINUX BASICS
WILDCARDS
* - represents zero or more characters
? - represents a single character
[] - represents a range of characters
ls
barry.txt blah.txt bob example.png firstfile foo1 foo2
foo3 frog.png secondfile thirdfile video.mpeg
ls b*
barry.txt blah.txt bob
16
LINUX BASICS
CTRL + *
‣ Ctrl+D: Used to terminate input or exit the terminal or shell
‣ Ctrl+Z: Used to suspend foreground processes
‣ Ctrl+C: Used to kill foreground processes
17
LINUX BASICS
BACKGROUND & FOREGROUND
$ yes > /dev/null
^Z
[1]+ Stopped yes > /dev/null
$ jobs
[1]+ Stopped yes > /dev/null
$ yes > /dev/null &
[2] 20126
$ jobs
[1]+ Stopped yes > /dev/null
[2]- Running yes > /dev/null &
$ bg %1
[1]+ yes > /dev/null &
$ jobs
[1]- Running yes > /dev/null &
[2]+ Running yes > /dev/null &
$ fg %
yes > /dev/null
^Z
[2]+ Stopped yes > /dev/null
18
LINUX BASICS
EXECUTING FILES
$ php myscript.php
$ php -f myscript.php
$ vi myscript.php
#!/usr/bin/env php
<?php
....
$ ./myscript.php
$ mv myscript.php myscript
$ myscript
command not found: myscript
$ ./myscript
19
LINUX BASICS
LINUX RESURCES
‣Linux intro
‣http://www.tldp.org/LDP/intro-linux/html/
intro_10.html
‣Linux tutorial
‣http://ryanstutorials.net/linuxtutorial/
‣OhMyZsh
‣https://github.com/robbyrussell/oh-my-zsh
20

More Related Content

What's hot

Terminal Commands (Linux - ubuntu) (part-1)
Terminal Commands  (Linux - ubuntu) (part-1)Terminal Commands  (Linux - ubuntu) (part-1)
Terminal Commands (Linux - ubuntu) (part-1)
raj upadhyay
 
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
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
Tushar B Kute
 
Linux basics
Linux basicsLinux basics
Linux basics
Shagun Rathore
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
Harish1983
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
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
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
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 basic
Linux basicLinux basic
Linux basic
Pragyagupta37
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
Michael Olafusi
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
Ramasubbu .P
 
Basic commands
Basic commandsBasic commands
Basic commands
ambilivava
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commandsaaj_sarkar06
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
atozknowledge .com
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
mentorsnet
 
Linux Getting Started
Linux Getting StartedLinux Getting Started
Linux Getting Started
Angus Li
 

What's hot (20)

Terminal Commands (Linux - ubuntu) (part-1)
Terminal Commands  (Linux - ubuntu) (part-1)Terminal Commands  (Linux - ubuntu) (part-1)
Terminal Commands (Linux - ubuntu) (part-1)
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
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
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
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 basic
Linux basicLinux basic
Linux basic
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Basic commands
Basic commandsBasic commands
Basic commands
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Linux
Linux Linux
Linux
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
 
Linux Getting Started
Linux Getting StartedLinux Getting Started
Linux Getting Started
 

Similar to 17 Linux Basics #burningkeyboards

Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
SharanShrinivasan1
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
rowiebornia
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
DavidMaina47
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkii
cmdept1
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
Anatoliy Okhotnikov
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
kishore1986
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Chander Pandey
 
Lamp ppt
Lamp pptLamp ppt
Lamp pptReka
 
UNIX Basics and Cluster Computing
UNIX Basics and Cluster ComputingUNIX Basics and Cluster Computing
UNIX Basics and Cluster Computing
Bioinformatics and Computational Biosciences Branch
 
Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
RajKumar Rampelli
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
Vinoth Sn
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to UnixSudharsan S
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
Gerard Braad
 

Similar to 17 Linux Basics #burningkeyboards (20)

Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkiiIntroduction khgjkhygkjiyhgikjyhgikygkii
Introduction khgjkhygkjiyhgikjyhgikygkii
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
 
Linux
LinuxLinux
Linux
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
 
UNIX Basics and Cluster Computing
UNIX Basics and Cluster ComputingUNIX Basics and Cluster Computing
UNIX Basics and Cluster Computing
 
Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Linux
LinuxLinux
Linux
 
3. intro
3. intro3. intro
3. intro
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 

More from Denis Ristic

Magento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HRMagento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HR
Denis Ristic
 
Continuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVzContinuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVz
Denis Ristic
 
25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards
Denis Ristic
 
24 Scrum #burningkeyboards
24 Scrum #burningkeyboards24 Scrum #burningkeyboards
24 Scrum #burningkeyboards
Denis Ristic
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards
Denis Ristic
 
22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards
Denis Ristic
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
Denis Ristic
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards
Denis Ristic
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
Denis Ristic
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
Denis Ristic
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards
Denis Ristic
 
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
Denis Ristic
 
14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards
Denis Ristic
 
13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards
Denis Ristic
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboards
Denis Ristic
 
11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards
Denis Ristic
 
10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards
Denis Ristic
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
Denis Ristic
 
08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards
Denis Ristic
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
Denis Ristic
 

More from Denis Ristic (20)

Magento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HRMagento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HR
 
Continuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVzContinuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVz
 
25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards
 
24 Scrum #burningkeyboards
24 Scrum #burningkeyboards24 Scrum #burningkeyboards
24 Scrum #burningkeyboards
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards
 
22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards
 
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
 
14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards
 
13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboards
 
11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards
 
10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
 
08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

17 Linux Basics #burningkeyboards

  • 2. LINUX BASICS WHAT IS LINUX? ‣ An operating system is software that manages all of the hardware resources associated with your desktop or laptop. ‣ The OS is comprised of a number of pieces: ‣ The Bootloader: The software that manages the boot process of your computer. For most users, this will simply be a splash screen that pops up and eventually goes away to boot into the operating system. ‣ The kernel: This is the one piece of the whole that is actually called “Linux”. The kernel is the core of the system and manages the CPU, memory, and peripheral devices. The kernel is the “lowest” level of the OS. ‣ Daemons: These are background services (printing, sound, scheduling, etc) that either start up during boot, or after you log into the desktop. ‣ The Shell: This is a command process that allows you to control the computer via commands typed into a text interface. ‣ Graphical Server: This is the sub-system that displays the graphics on your monitor. It is commonly referred to as the X server or just “X”. ‣ Desktop Environment: This is the piece of the puzzle that the users actually interact with. There are many desktop environments to choose from (Unity, GNOME, Cinnamon, Enlightenment, KDE, XFCE, etc). Each desktop environment includes built-in applications (such as file managers, configuration tools, web browsers, games, etc). ‣ Applications: Desktop environments do not offer the full array of apps. Just like Windows and Mac, Linux offers thousands upon thousands of high-quality software titles that can be easily found and installed. 2
  • 4. LINUX BASICS FILE SYSTEM ‣ "On a UNIX system, everything is a file; if something is not a file, it is a process." ‣ This statement is true because there are special files that are more than just files (named pipes and sockets, for instance), but to keep things simple, saying that everything is a file is an acceptable generalization. ‣ A Linux system makes no difference between a file and a directory, since a directory is just a file containing names of other files. ‣ Programs, services, texts, images, and so forth, are all files. Input and output devices, and generally all devices, are considered to be files, according to the system. 4
  • 5. LINUX BASICS FILE SYSTEM dristic @ MACBOOK [~] ➜ ls -la total 13936 drwxr-xr-x+ 88 dristic staff 2992 12 Srp 21:02 . drwxr-xr-x 6 dristic staff 204 3 Ožu 12:26 .. -rw-r--r-- 1 dristic staff 266 2 Svi 2016 .499481.padl drwxr-xr-x 3 dristic staff 102 9 Stu 2016 AndroidStudio2.0 ‣ - Regular file ‣ d Directory ‣ l Link ‣ c Special file ‣ s Socket ‣ p Named pipe ‣ b Block device 5
  • 6. LINUX BASICS SPECIAL FILES ‣ ~/.profile is the shell startup file; .profile will get executed whenever you login. It is used to set environment variables, aliases and shell options such as $PATH ‣ ~/.ssh/config is the SSH client configuration file. ‣ ~/.history is a file that contains history of executed commands 6
  • 7. LINUX BASICS BASIC COMMANDS ‣ awk Pattern-directed scanning and processing language ‣ cat Display file’s contents to the standard output device ‣ cd Change to directory. ‣ chkconfig Turn on or off services on boot time. ‣ chmod Change a file’s permissions. ‣ chown Change who owns a file. ‣ clear Clear a command line screen/window for a fresh start. ‣ cp Copy files and directories. ‣ date Display or set the system date and time. ‣ df Display used and available disk space. ‣ du Show how much space each file takes up. 7
  • 8. LINUX BASICS BASIC COMMANDS ‣ file Determine what type of data is within a file. ‣ find Search for files matching a provided pattern. ‣ grep Search files or output for a particular pattern. ‣ kill Stop a process. If the process refuses to stop, use kill -9 pid. ‣ less View the contents of a file one page at a time. ‣ ln Create a shortcut. ‣ locate Search a copy of your filesystem for the specified filename. ‣ ls List directory contents. ‣ man Display the help information for the specified command. ‣ mkdir Create a new directory. 8
  • 9. LINUX BASICS BASIC COMMANDS ‣ mv Rename or move file(s) or directories. ‣ passwd Change the password or allow (for the system administrator) to change any password. ‣ ps Display a snapshot of the currently running processes. ‣ pwd Display the pathname for the current directory. ‣ rm Remove (delete) file(s) and/or directories. ‣ rmdir Delete empty directories. ‣ sed Short for "stream editor", allows you to filter and transform text. ‣ service Stop, start, restart or find the status of system services. ‣ ssh Remotely log in to another Linux machine, over the network. ‣ su Switch to another user account. 9
  • 10. LINUX BASICS BASIC COMMANDS ‣ tail Display the last n lines of a file (the default is 10). ‣ tar Store and extract files from a tarfile (.tar) or tarball (.tar.gz or .tgz). ‣ top Displays the resources being used on your system. ‣ touch filename Create an empty file with the specified name. ‣ wc Word, line, character, and byte count ‣ who Display who is logged on. ‣ stat The stat utility displays information about the file pointed to by file. ‣ id Returns current user identity ‣ crontab Maintains crontab files for individual users ‣ nohup Invoke a utility immune to hangups 10
  • 11. LINUX BASICS BASIC COMMANDS ‣ netstat Show network status ‣ ping send ICMP ECHO_REQUEST packets to network hosts ‣ telnet user interface to the TELNET protocol ‣ dig DNS lookup utility ‣ traceroute print the route packets take to network host ‣ vi a programmers text editor ‣ nano editor, an enhanced free Pico clone ‣ apt-get is the command-line tool for handling packages ‣ yum is an interactive, rpm based, package manager ‣ dpkg is a tool to install, build, remove and manage Debian packages. 11
  • 12. LINUX BASICS CD EXPLAINED ‣ cd Returns you to your login directory ‣ cd ~ Also returns you to your login directory ‣ cd / Takes you to the entire system's root directory ‣ cd /root Takes you to the home directory of the root ‣ cd /home Takes you to the home directory, where user login directories are usually stored ‣ cd .. Moves you up one directory ‣ cd /dir1/subdir This absolute path takes you directly to subdir, a subdirectory of dir1 ‣ cd ../../dir3/dir2 This relative path takes you up two directories, then to dir3, then to the dir2 directory 12
  • 13. LINUX BASICS CHMOD EXPLAINED chmod <people><+/-><permissions> Example: chmod o-w (deny others from editing the file) Example: chmod u+rwx (give the owner full control) r - Read w - Write x - Execute u - The owner of the file g - The group that the file belongs to o - Anybody who is not one of the above a - All users + - Add permissions - - Remove permissions : 1st octet represents permissions for the owner. r w x T : 2nd octet represents permissions for the group. Owner: 4 2 1 7 : 3rd octet represents permissions for everyone else Group: 0 0 0 0 : For each octet, start at 0 and: Other: 0 0 0 0 : +4 for read permission. : +2 for write permission. Command: chmod 700 : +1 for execute permission. 13
  • 14. LINUX BASICS CRONTAB EXPLAINED crontab -e # Minute Hour Day of Month Month Day of Week Command # (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat) 0 2 12 * * /usr/bin/find 14
  • 15. LINUX BASICS PIPING AND REDIRECTION ls | head -3 | tail -1 echo “Hello World!” > file.txt echo “Hello World!” >> file.txt wc -l < file.txt ls -l video.mpg blah.foo 2> errors.txt ls -l video.mpg blah.foo > myoutput 2>&1 ls | head -3 | tail -1 > myoutput 15
  • 16. LINUX BASICS WILDCARDS * - represents zero or more characters ? - represents a single character [] - represents a range of characters ls barry.txt blah.txt bob example.png firstfile foo1 foo2 foo3 frog.png secondfile thirdfile video.mpeg ls b* barry.txt blah.txt bob 16
  • 17. LINUX BASICS CTRL + * ‣ Ctrl+D: Used to terminate input or exit the terminal or shell ‣ Ctrl+Z: Used to suspend foreground processes ‣ Ctrl+C: Used to kill foreground processes 17
  • 18. LINUX BASICS BACKGROUND & FOREGROUND $ yes > /dev/null ^Z [1]+ Stopped yes > /dev/null $ jobs [1]+ Stopped yes > /dev/null $ yes > /dev/null & [2] 20126 $ jobs [1]+ Stopped yes > /dev/null [2]- Running yes > /dev/null & $ bg %1 [1]+ yes > /dev/null & $ jobs [1]- Running yes > /dev/null & [2]+ Running yes > /dev/null & $ fg % yes > /dev/null ^Z [2]+ Stopped yes > /dev/null 18
  • 19. LINUX BASICS EXECUTING FILES $ php myscript.php $ php -f myscript.php $ vi myscript.php #!/usr/bin/env php <?php .... $ ./myscript.php $ mv myscript.php myscript $ myscript command not found: myscript $ ./myscript 19
  • 20. LINUX BASICS LINUX RESURCES ‣Linux intro ‣http://www.tldp.org/LDP/intro-linux/html/ intro_10.html ‣Linux tutorial ‣http://ryanstutorials.net/linuxtutorial/ ‣OhMyZsh ‣https://github.com/robbyrussell/oh-my-zsh 20