SlideShare uma empresa Scribd logo
1 de 27
Bootcamp
Linux Commands...
@Nexthoughts
Background of Linux
Version of UNIX
Linus Torvalds – Creator of Linux
Open Source Operating System
Free Software
Source Code Available
Where is Linux used?
→ 75% of respondents were already using Linux and another
14% were evaluating it
→ 43% of all web sites use Linux servers running the Apache
Web server
How Linux is used?
Personal Workstation
File and Print Server
Internet Service Provider
Three-tier Client/Server
About Kernel:
Linux kernel for free
Kernel is central component
Kernel can be customized to user’s needs
Unix Commands
A command is a program which interacts with the kernel to
provide the environment and perform the functions called for
by the user.
A command can be: a built-in shell command; an executable
shell file, known as a shell script; or a source compiled, object
code file.
The shell is a command line interpreter. The user interacts
with the kernel through the shell. You can write ASCII (text)
scripts to be acted upon by a shell.
Taking Help
The man command displays reference pages for the
command you specify.
The UNIX man pages (man is short for manual ) cover every
command available.
To search for a man page, enter man followed by the name of the
command to find .
For example:
% man cp
Or try:
% man man
Files Related Commands
ls
List directory contents
Has whole bunch of options.
•% ls
all files except those starting with a
“.”
•% ls -a
all
•% ls -A
all without “.” and “..”
• % ls -F
append “/” to dirs and “*” to
executables
• % ls -l
long format
• % ls -al
• % ls -lt
sort by modification time (latest -
earliest)
• % ls -ltr
reverse
cp
Copies files / directories.
% cp [options] <source> <destination>
% cp file1 file2
% cp file1 [file2] … /directory
Useful option: -i to prevent overwriting existing files and
prompt the user to confirm.
mv
Moves or renames files/directories.
% mv <source> <destination>
The <source> gets removed
% mv file1 dir/
% mv dir1 dir2
rm
Removes file(s) and/or directories.
% rm file1 [file2]
% rm -r dir1 [dir2]
Directories
cd
Changes your current directory to a new one.
% cd /some/other/dir
Absolute path
% cd subdir
Assuming subdir is in the current directory.
% cd
Returns you to your home directory.
mkdir
Creates a directory.
% mkdir newdir
pwd
Displays personal working directory,
i.e. your current directory.
% pwd
rmdir
Removes a directory.
% rmdir dirname
chmod
Changes file permissions
Possible invocations
% chmod 600 filename
-rw------- 1 user group 2785 Feb 8 14:18 filename
(a bit not intuitive where 600 comes from)
(owner) (group) (others)
chmod [number][number][number] file1
Number = (read)4 + (write)2 + (execute)1
Example: Chmod 754 file1
for owner: read, write and execute permissions (4+2+1)
for group: read and execute permissions (4+0+1)
for others: only read permission (4+0+0)
chmod
Some of the things these commands manipulate:
The time stamp: Each file has three dates associated with it. These are creation
time, last modification time and last access time.
The owner: the owner of files
The group: the group of users
The permissions: read, write, execute permissions of files. The permissions tell
unix who can access what file, or change it, or, in the case of programs, execute
it. Each of these permissions can be toggled separately for the owner, the group,
and all the other users.
chmod
drwxr-xr-x 2 dag users 6 Dec 6 2000 netscape
owner
group
others
file name
read, write, execute
permissions of files
grep
Searches its input for a pattern.
The pattern can be a simple substring or a complex
regular expression.
If a line matches, it’s directed to STDOUT; otherwise,
it’s discarded.
% echo “blah-foo” | grep blah
Will print the matching line
% echo “blah-foo” | grep zee
Will not.
alias
Defined a new name for a command
% alias
with no arguments lists currently active aliases
% alias newcommand oldcommand
defines a newcommand
ssh
ssh (SSH client) is a program for logging into a
remote machine and for executing commands on a remote
machine.
It provide secure encrypted communications between two
untrusted hosts over an insecure network.
ssh -i /home/narendra/.ssh/keir_wp.pem -o
IdentitiesOnly=yes ubuntu@52.19.236.56 -v
scp
Scp (Secure Copy) is a command line tool to copy or
transfer files across hosts.
It uses the same kind of security mechanism like the
ssh program.
It uses an ssh connection in the background to perform
the file transfer.
Scp <source> <destination>
Copy the file "foobar.txt" from a remote host to the
local host
scp your_username@remotehost.edu:foobar.txt
/some/local/directory
Copy the file "foobar.txt" from remote host "rh1.edu"
to remote host "rh2.edu"
clear
Clears the screen
There’s an alias for it: Ctrl+L
Example sequence:
% cal
% clear
% cal
Ctrl+L
exit / logout
Exit from your login session.
% exit
% logout
shutdown
Causes system to shutdown or reboot
cleanly.
May require superuser privileges
% shutdown -h now - stop
% shutdown -r now - reboot
Thanks for listening...

Mais conteúdo relacionado

Mais procurados

Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Ahmed El-Arabawy
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating Systemsubhsikha
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Wave Digitech
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Ahmed El-Arabawy
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux Harish R
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Edureka!
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Ahmed El-Arabawy
 

Mais procurados (20)

Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux commands
Linux commands Linux commands
Linux commands
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Linux
LinuxLinux
Linux
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
Linux Tutorial For Beginners | Linux Administration Tutorial | Linux Commands...
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands
 

Destaque (20)

Grails internationalization-160524154831
Grails internationalization-160524154831Grails internationalization-160524154831
Grails internationalization-160524154831
 
Grails custom tag lib
Grails custom tag libGrails custom tag lib
Grails custom tag lib
 
G pars
G parsG pars
G pars
 
Twilio
TwilioTwilio
Twilio
 
Spring boot
Spring bootSpring boot
Spring boot
 
Gorm
GormGorm
Gorm
 
Groovy
GroovyGroovy
Groovy
 
Groovy intro
Groovy introGroovy intro
Groovy intro
 
Java reflection
Java reflectionJava reflection
Java reflection
 
MetaProgramming with Groovy
MetaProgramming with GroovyMetaProgramming with Groovy
MetaProgramming with Groovy
 
Actors model in gpars
Actors model in gparsActors model in gpars
Actors model in gpars
 
Grails Controllers
Grails ControllersGrails Controllers
Grails Controllers
 
Grails services
Grails servicesGrails services
Grails services
 
Groovy DSL
Groovy DSLGroovy DSL
Groovy DSL
 
Grails with swagger
Grails with swaggerGrails with swagger
Grails with swagger
 
Command objects
Command objectsCommand objects
Command objects
 
Grails domain classes
Grails domain classesGrails domain classes
Grails domain classes
 
Jmh
JmhJmh
Jmh
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Reactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaReactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJava
 

Semelhante a Bootcamp linux commands

Semelhante a Bootcamp linux commands (20)

Linux presentation
Linux presentationLinux presentation
Linux presentation
 
3. intro
3. intro3. intro
3. intro
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
cisco
ciscocisco
cisco
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Linux
LinuxLinux
Linux
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Linux
LinuxLinux
Linux
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 

Mais de NexThoughts Technologies (20)

Alexa skill
Alexa skillAlexa skill
Alexa skill
 
GraalVM
GraalVMGraalVM
GraalVM
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Apache commons
Apache commonsApache commons
Apache commons
 
HazelCast
HazelCastHazelCast
HazelCast
 
MySQL Pro
MySQL ProMySQL Pro
MySQL Pro
 
Microservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & ReduxMicroservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & Redux
 
Swagger
SwaggerSwagger
Swagger
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Arango DB
Arango DBArango DB
Arango DB
 
Jython
JythonJython
Jython
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
Smart Contract samples
Smart Contract samplesSmart Contract samples
Smart Contract samples
 
My Doc of geth
My Doc of gethMy Doc of geth
My Doc of geth
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Ethereum genesis
Ethereum genesisEthereum genesis
Ethereum genesis
 
Ethereum
EthereumEthereum
Ethereum
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
An Introduction to Redux
An Introduction to ReduxAn Introduction to Redux
An Introduction to Redux
 
Google authentication
Google authenticationGoogle authentication
Google authentication
 

Último

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Último (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Bootcamp linux commands

  • 2. Background of Linux Version of UNIX Linus Torvalds – Creator of Linux Open Source Operating System Free Software Source Code Available
  • 3. Where is Linux used? → 75% of respondents were already using Linux and another 14% were evaluating it → 43% of all web sites use Linux servers running the Apache Web server
  • 4. How Linux is used? Personal Workstation File and Print Server Internet Service Provider Three-tier Client/Server About Kernel: Linux kernel for free Kernel is central component Kernel can be customized to user’s needs
  • 5. Unix Commands A command is a program which interacts with the kernel to provide the environment and perform the functions called for by the user. A command can be: a built-in shell command; an executable shell file, known as a shell script; or a source compiled, object code file. The shell is a command line interpreter. The user interacts with the kernel through the shell. You can write ASCII (text) scripts to be acted upon by a shell.
  • 6. Taking Help The man command displays reference pages for the command you specify. The UNIX man pages (man is short for manual ) cover every command available. To search for a man page, enter man followed by the name of the command to find . For example: % man cp Or try: % man man
  • 8. ls List directory contents Has whole bunch of options. •% ls all files except those starting with a “.” •% ls -a all •% ls -A all without “.” and “..” • % ls -F append “/” to dirs and “*” to executables • % ls -l long format • % ls -al • % ls -lt sort by modification time (latest - earliest) • % ls -ltr reverse
  • 9. cp Copies files / directories. % cp [options] <source> <destination> % cp file1 file2 % cp file1 [file2] … /directory Useful option: -i to prevent overwriting existing files and prompt the user to confirm.
  • 10. mv Moves or renames files/directories. % mv <source> <destination> The <source> gets removed % mv file1 dir/ % mv dir1 dir2
  • 11. rm Removes file(s) and/or directories. % rm file1 [file2] % rm -r dir1 [dir2]
  • 13. cd Changes your current directory to a new one. % cd /some/other/dir Absolute path % cd subdir Assuming subdir is in the current directory. % cd Returns you to your home directory.
  • 15. pwd Displays personal working directory, i.e. your current directory. % pwd
  • 17. chmod Changes file permissions Possible invocations % chmod 600 filename -rw------- 1 user group 2785 Feb 8 14:18 filename (a bit not intuitive where 600 comes from) (owner) (group) (others) chmod [number][number][number] file1 Number = (read)4 + (write)2 + (execute)1 Example: Chmod 754 file1 for owner: read, write and execute permissions (4+2+1) for group: read and execute permissions (4+0+1) for others: only read permission (4+0+0)
  • 18. chmod Some of the things these commands manipulate: The time stamp: Each file has three dates associated with it. These are creation time, last modification time and last access time. The owner: the owner of files The group: the group of users The permissions: read, write, execute permissions of files. The permissions tell unix who can access what file, or change it, or, in the case of programs, execute it. Each of these permissions can be toggled separately for the owner, the group, and all the other users.
  • 19. chmod drwxr-xr-x 2 dag users 6 Dec 6 2000 netscape owner group others file name read, write, execute permissions of files
  • 20. grep Searches its input for a pattern. The pattern can be a simple substring or a complex regular expression. If a line matches, it’s directed to STDOUT; otherwise, it’s discarded. % echo “blah-foo” | grep blah Will print the matching line % echo “blah-foo” | grep zee Will not.
  • 21. alias Defined a new name for a command % alias with no arguments lists currently active aliases % alias newcommand oldcommand defines a newcommand
  • 22. ssh ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It provide secure encrypted communications between two untrusted hosts over an insecure network. ssh -i /home/narendra/.ssh/keir_wp.pem -o IdentitiesOnly=yes ubuntu@52.19.236.56 -v
  • 23. scp Scp (Secure Copy) is a command line tool to copy or transfer files across hosts. It uses the same kind of security mechanism like the ssh program. It uses an ssh connection in the background to perform the file transfer. Scp <source> <destination> Copy the file "foobar.txt" from a remote host to the local host scp your_username@remotehost.edu:foobar.txt /some/local/directory Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"
  • 24. clear Clears the screen There’s an alias for it: Ctrl+L Example sequence: % cal % clear % cal Ctrl+L
  • 25. exit / logout Exit from your login session. % exit % logout
  • 26. shutdown Causes system to shutdown or reboot cleanly. May require superuser privileges % shutdown -h now - stop % shutdown -r now - reboot