SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Command-line 101
GETTING TO
KNOW THE
UNIX/LINUX CLI
https://commons.wikimedia.org/wiki/File:Ken_Thompson_(sitting)_and_Dennis_Ritchie_at_PDP-11_(2876612463).jpg
Warning
http://knowyourmeme.com/memes/i-have-no-idea-what-i-m-doinghttp://nedroid.com/2012/05/honk-the-databus/
What is the Command Line?
A terminal window, is a text-only window in a graphical user interface
(GUI) that emulates a console.
A GUI is a type of human-computer interface (i.e., a system for people to
interact with a computer) that uses windows, icons, pull-down menus and a
pointer and that can be manipulated by a mouse (and usually to some extent
by a keyboard as well).
A command is an instruction telling a computer to do something, such as
launch a program.
A command line interface (CLI) is an all-text display mode that has a
command interpreter running in it and that shows commands, including their
arguments, and other data as they are typed in at the keyboard as well as
the results of most such commands.
A command interpreter, also referred to as a shell, is a program whose
primary function is to read commands that are typed into a console or
terminal window and then execute (i.e., run) them.
From the Linux Information Project (http://www.linfo.org/terminal_window.html)
Navigation
> pwd
Shows the path to the current directory.
(Where am I?)
“print working directory”
Navigation
> ls
List the contents of the current directory
Options:
• -l structured (includes permissions,
owners, access dates) long list format
• -R recursive (show subdirectories too)
• -a all (show hidden system files too)
(What’s in here?)
“list contents”
Navigation
In your terminal, try:
> ls --help
This will list all the available options with brief explanations for
each. Some might not make sense yet – don’t worry. Try a few out! Can
you figure out what the following do?
> ls -r
> ls -A
> ls –s –h –S
Useful CLI tips and tricks
If you want to… Try:
See basic help <command> --help
See the manual for a command man <command>
Exit from manual or page view q
Show last command you entered up arrow
Autocomplete filename or path tab
Kill a process CTRL + c
Jump to beginning of a command CTRL + a
Navigation
> cd <directory name>
Changes to the specified directory
(How do I get over there?)
> cd .. Up one level
> cd ../.. Up two levels (etc.)
> cd ~ Home directory
> cd Home directory
> cd - Change to last directory
“change directory”
READING, CREATING, COPYING, REMOVING, EDITING
http://www.slashfilm.com/hackers-oral-history/
Creating directories
> mkdir <name>
Makes a new directory called <name>
(How can I make a new folder?)
“make directory”
> mkdir –v Verbose – output info after
> mkdir –p Create parents as needed
Deleting directories
> rmdir <name>
Deletes directory called <name>. Directory
MUST be empty for the command to succeed.
(How can I remove an existing folder?)
“remove directory”
> rmdir –v Verbose – output info after
> rmdir –p Delete parents as well
(if also empty – if there are
files in there or other
directories it will fail)
Deleting files
> rm <filename>
Deletes file called <filename>.
(How can I remove an existing file?)
“remove”
> rm -v Verbose – output info after
> rm –i Prompt before every deletion
> rm –r
Recursive – remove subdirs and
contents below as well
> rm –f Force – ignore warnings
DANGER!
rm is a powerful
command, and you can
easily accidentally
delete a lot with the
–r and –f options…
https://steemit.com/health/@kyusho/danger-will-robinson
Copying files
> cp <file1> <file2>
Makes a copy of <file1> in location and with
name of <file2>. Example:
(How can I copy a file to another place?)
“copy”
> cp atom/LICENSE /vagrant/atom-license.txt
NOTE: if /vagrant/atom-license.txt already exists,
then it will be overwritten!
See the manual for other options
Moving files
> mv <file1> <file2>
Moves <file1> to new location <file2>. Can
rename file as part of the operation.
(How can I move a file to another place?)
“move”
NOTE: if <file2> already exists, then it will be
overwritten by the contents of <file1>
See the manual for other options
Reading files
(How can I view the contents of a file?)
> less <filename>
Show 1 page at a time. Space bar
will page through, q to quit
> cat <filename> Print whole file in terminal
> head <filename>
Display first 10 lines of
<filename>
> tail <filename> Display last 10 lines
> tail –f <filename>
Display last 10 lines and
contents as the file grows.
Useful for logs, etc.
Show current date and time > date
See a calendar of the current month > cal
See a calendar of the current year > cal -y
List users logged on to this server > who
Show your username > whoami
List users and session info > w
https://www.therefinedgeek.com.au/index.php/2012/10/02/mcpixel-oh-the-lols-you-will-have/
Clear current commands out of view > clear
Clear current commands out of view > CTRL + L
Show full history of commands in
this session
> history
copy to clipboard in the terminal > CTRL + INSERT
paste from clipboard in terminal > SHIFT + INSERT
Repeat the last command > !!
Exit current session, close terminal > exit
https://www.therefinedgeek.com.au/index.php/2012/10/02/mcpixel-oh-the-lols-you-will-have/
Resources – Cheat Sheets
• FossWire Unix/Linux Command
Reference
• GettingGeneticsDone blog
cheat sheet maintained at
Tufts University
• CheatSheetWorld Unix/Linux
cheat sheet
• LinOxide Linux cheat sheet
There are plenty more out there!
Resources – Tutorials
• LinuxCommand – Learning the Shell tutorial
• LearnPythonTheHardWay – Command Line Crash
Course
• Ryan’s Tutorials – Linux Tutorial
• Learn Enough Society – Learn Enough of the
Command Line to be Dangerous
There are plenty more out there!
Getting Started with the Command Line Interface

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Vi editor
Vi editorVi editor
Vi editor
 
Linux distributions
Linux    distributionsLinux    distributions
Linux distributions
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
 
Introduction to Ubuntu
Introduction to UbuntuIntroduction to Ubuntu
Introduction to Ubuntu
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Bash shell
Bash shellBash shell
Bash shell
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
VI editor in unix
VI editor in unix VI editor in unix
VI editor in unix
 
IPT Chapter 3 Data Mapping and Exchange - Dr. J. VijiPriya
IPT Chapter 3 Data Mapping and Exchange - Dr. J. VijiPriyaIPT Chapter 3 Data Mapping and Exchange - Dr. J. VijiPriya
IPT Chapter 3 Data Mapping and Exchange - Dr. J. VijiPriya
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xampp
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
WebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction PresentationWebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction Presentation
 

Ähnlich wie Getting Started with the Command Line Interface

Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUXAVI DHALL
 
Bash cheat sheet
Bash cheat sheetBash cheat sheet
Bash cheat sheetJogesh Rao
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to UnixSudharsan S
 
Operating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptOperating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptPDhivyabharathi2
 
Linux command-cheat-sheet
Linux command-cheat-sheetLinux command-cheat-sheet
Linux command-cheat-sheetIfshar Ahmad
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editorshanmuga rajan
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command ShellTushar B Kute
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:wensheng wei
 
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiPriyadarshini648418
 
Linux Administration
Linux AdministrationLinux Administration
Linux AdministrationHarish1983
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administrationharirxg
 

Ähnlich wie Getting Started with the Command Line Interface (20)

Linux lecture5
Linux lecture5Linux lecture5
Linux lecture5
 
Linux cheat sheet
Linux cheat sheetLinux cheat sheet
Linux cheat sheet
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUX
 
Bash cheat sheet
Bash cheat sheetBash cheat sheet
Bash cheat sheet
 
Bash cheat sheet
Bash cheat sheetBash cheat sheet
Bash cheat sheet
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
60761 linux
60761 linux60761 linux
60761 linux
 
Operating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptOperating System Laboratory presentation .ppt
Operating System Laboratory presentation .ppt
 
Linux command-cheat-sheet
Linux command-cheat-sheetLinux command-cheat-sheet
Linux command-cheat-sheet
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:
 
Linux
LinuxLinux
Linux
 
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Linux
LinuxLinux
Linux
 
Dos commands new
Dos commands new Dos commands new
Dos commands new
 

Mehr von Artefactual Systems - AtoM

Things I wish I'd known - AtoM tips, tricks, and gotchas
Things I wish I'd known - AtoM tips, tricks, and gotchasThings I wish I'd known - AtoM tips, tricks, and gotchas
Things I wish I'd known - AtoM tips, tricks, and gotchasArtefactual Systems - AtoM
 
Creating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with VagrantCreating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with VagrantArtefactual Systems - AtoM
 
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...Artefactual Systems - AtoM
 
Looking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and futureLooking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and futureArtefactual Systems - AtoM
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 
An Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual SystemsAn Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual SystemsArtefactual Systems - AtoM
 
National Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshopNational Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshopArtefactual Systems - AtoM
 

Mehr von Artefactual Systems - AtoM (20)

CSV import in AtoM
CSV import in AtoMCSV import in AtoM
CSV import in AtoM
 
Things I wish I'd known - AtoM tips, tricks, and gotchas
Things I wish I'd known - AtoM tips, tricks, and gotchasThings I wish I'd known - AtoM tips, tricks, and gotchas
Things I wish I'd known - AtoM tips, tricks, and gotchas
 
AtoM Community Update: 2019-05
AtoM Community Update: 2019-05AtoM Community Update: 2019-05
AtoM Community Update: 2019-05
 
Creating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with VagrantCreating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with Vagrant
 
Searching in AtoM
Searching in AtoMSearching in AtoM
Searching in AtoM
 
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
 
AtoM Implementations
AtoM ImplementationsAtoM Implementations
AtoM Implementations
 
AtoM Data Migrations
AtoM Data MigrationsAtoM Data Migrations
AtoM Data Migrations
 
Looking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and futureLooking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and future
 
Contributing to the AtoM documentation
Contributing to the AtoM documentationContributing to the AtoM documentation
Contributing to the AtoM documentation
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
 
AtoM feature development
AtoM feature developmentAtoM feature development
AtoM feature development
 
Constructing SQL queries for AtoM
Constructing SQL queries for AtoMConstructing SQL queries for AtoM
Constructing SQL queries for AtoM
 
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
 
Installing and Upgrading AtoM
Installing and Upgrading AtoMInstalling and Upgrading AtoM
Installing and Upgrading AtoM
 
Get to Know AtoM's Codebase
Get to Know AtoM's CodebaseGet to Know AtoM's Codebase
Get to Know AtoM's Codebase
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An IntroductionAtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
An Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual SystemsAn Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual Systems
 
National Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshopNational Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshop
 

Kürzlich hochgeladen

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 

Kürzlich hochgeladen (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 

Getting Started with the Command Line Interface

  • 1. Command-line 101 GETTING TO KNOW THE UNIX/LINUX CLI https://commons.wikimedia.org/wiki/File:Ken_Thompson_(sitting)_and_Dennis_Ritchie_at_PDP-11_(2876612463).jpg
  • 3. What is the Command Line? A terminal window, is a text-only window in a graphical user interface (GUI) that emulates a console. A GUI is a type of human-computer interface (i.e., a system for people to interact with a computer) that uses windows, icons, pull-down menus and a pointer and that can be manipulated by a mouse (and usually to some extent by a keyboard as well). A command is an instruction telling a computer to do something, such as launch a program. A command line interface (CLI) is an all-text display mode that has a command interpreter running in it and that shows commands, including their arguments, and other data as they are typed in at the keyboard as well as the results of most such commands. A command interpreter, also referred to as a shell, is a program whose primary function is to read commands that are typed into a console or terminal window and then execute (i.e., run) them. From the Linux Information Project (http://www.linfo.org/terminal_window.html)
  • 4. Navigation > pwd Shows the path to the current directory. (Where am I?) “print working directory”
  • 5. Navigation > ls List the contents of the current directory Options: • -l structured (includes permissions, owners, access dates) long list format • -R recursive (show subdirectories too) • -a all (show hidden system files too) (What’s in here?) “list contents”
  • 6. Navigation In your terminal, try: > ls --help This will list all the available options with brief explanations for each. Some might not make sense yet – don’t worry. Try a few out! Can you figure out what the following do? > ls -r > ls -A > ls –s –h –S
  • 7. Useful CLI tips and tricks If you want to… Try: See basic help <command> --help See the manual for a command man <command> Exit from manual or page view q Show last command you entered up arrow Autocomplete filename or path tab Kill a process CTRL + c Jump to beginning of a command CTRL + a
  • 8. Navigation > cd <directory name> Changes to the specified directory (How do I get over there?) > cd .. Up one level > cd ../.. Up two levels (etc.) > cd ~ Home directory > cd Home directory > cd - Change to last directory “change directory”
  • 9. READING, CREATING, COPYING, REMOVING, EDITING http://www.slashfilm.com/hackers-oral-history/
  • 10. Creating directories > mkdir <name> Makes a new directory called <name> (How can I make a new folder?) “make directory” > mkdir –v Verbose – output info after > mkdir –p Create parents as needed
  • 11. Deleting directories > rmdir <name> Deletes directory called <name>. Directory MUST be empty for the command to succeed. (How can I remove an existing folder?) “remove directory” > rmdir –v Verbose – output info after > rmdir –p Delete parents as well (if also empty – if there are files in there or other directories it will fail)
  • 12. Deleting files > rm <filename> Deletes file called <filename>. (How can I remove an existing file?) “remove” > rm -v Verbose – output info after > rm –i Prompt before every deletion > rm –r Recursive – remove subdirs and contents below as well > rm –f Force – ignore warnings
  • 13. DANGER! rm is a powerful command, and you can easily accidentally delete a lot with the –r and –f options… https://steemit.com/health/@kyusho/danger-will-robinson
  • 14. Copying files > cp <file1> <file2> Makes a copy of <file1> in location and with name of <file2>. Example: (How can I copy a file to another place?) “copy” > cp atom/LICENSE /vagrant/atom-license.txt NOTE: if /vagrant/atom-license.txt already exists, then it will be overwritten! See the manual for other options
  • 15. Moving files > mv <file1> <file2> Moves <file1> to new location <file2>. Can rename file as part of the operation. (How can I move a file to another place?) “move” NOTE: if <file2> already exists, then it will be overwritten by the contents of <file1> See the manual for other options
  • 16. Reading files (How can I view the contents of a file?) > less <filename> Show 1 page at a time. Space bar will page through, q to quit > cat <filename> Print whole file in terminal > head <filename> Display first 10 lines of <filename> > tail <filename> Display last 10 lines > tail –f <filename> Display last 10 lines and contents as the file grows. Useful for logs, etc.
  • 17. Show current date and time > date See a calendar of the current month > cal See a calendar of the current year > cal -y List users logged on to this server > who Show your username > whoami List users and session info > w https://www.therefinedgeek.com.au/index.php/2012/10/02/mcpixel-oh-the-lols-you-will-have/
  • 18. Clear current commands out of view > clear Clear current commands out of view > CTRL + L Show full history of commands in this session > history copy to clipboard in the terminal > CTRL + INSERT paste from clipboard in terminal > SHIFT + INSERT Repeat the last command > !! Exit current session, close terminal > exit https://www.therefinedgeek.com.au/index.php/2012/10/02/mcpixel-oh-the-lols-you-will-have/
  • 19. Resources – Cheat Sheets • FossWire Unix/Linux Command Reference • GettingGeneticsDone blog cheat sheet maintained at Tufts University • CheatSheetWorld Unix/Linux cheat sheet • LinOxide Linux cheat sheet There are plenty more out there!
  • 20. Resources – Tutorials • LinuxCommand – Learning the Shell tutorial • LearnPythonTheHardWay – Command Line Crash Course • Ryan’s Tutorials – Linux Tutorial • Learn Enough Society – Learn Enough of the Command Line to be Dangerous There are plenty more out there!