Introduction to Linux Command Line

undefined
 
INTRO TO THE LINUX
COMMAND LINE
 
Charles Reinke & Warren Davis
 
Networking Basics and Hacking Simulation
 
 
Hands-on, Minds-on Technology (HMTech) 2023
 
 
WHY COMMAND LINE?
 
Text interface to your computer
Referred to as the shell, terminal, console, or
prompt
Allows copy and paste of commands from
other sources, such as a website
Preferred interface for mainframes and
supercomputers
Compared with graphics, text is very light on
resources
 
2
 
WHY COMMAND LINE?
 
3
 
Efficient file management and system maintenance
Shell provides user commands and environment variables
Shell scripting automates long shell commands to make complex tasks easier
 
WHAT IS LINUX
 
Alternative 
Operating System
, like Windows or
Macintosh
Inspired by 
Unix
Open source
Only used on 2.6% of all desktop computers
But, used on over 96% of webservers and 
100%
of the world's 500 fastest supercomputers!
 
4
 
WHAT IS LINUX
 
5
 
Alternative 
Operating System
, like Windows or
Macintosh
Inspired by 
Unix
Open source
Only used on 2.6% of all desktop computers
But, used on over 96% of webservers and 
100%
of the world's 500 fastest supercomputers!
Also underpins ChromeOS (20% of all sub-$300
laptops)
Android is Linux-based, making Linux the
most-used general-purpose operating system!
 
OPENING A COMMAND PROMPT
 
Click the Windows button and type 
powershell
Click on the “Windows PowerShell” app
Prompt
 tells you the computer is ready to accept a command
Not a Linux environment 
yet
; we’re still in Windows
 
6
 
CONNECTING TO A LINUX SERVER
 
Type 
ssh bandit0@bandit.labs.overthewire.org –p 2220
 and hit
Enter
If you get a “Are you sure you want to continue connecting […]” message, type
yes
 and hit 
Enter
Enter 
bandit0
 for the password
Now we are in a Linux environment!
Let’s try running some basic commands…
 
7
 
BASIC LINUX COMMANDS
 
Type 
pwd
 and press the 
Enter
 or 
Return
 key
Case matters, 
PWD
 or 
Pwd
 won’t work
Prints out the shell’s current working directory
Try a few other commands:
ls
Lists the contents of the a directory
cd
Allows you to change your current directory
mkdir
Make a new directory
exit
Closes the terminal
Do you remember how to log back in? 
 
8
 
BASIC LINUX COMMANDS, CONT.
 
echo
Prints its arguments back out again
cat
Concatenate file contents (and print them out)
mv
Move or rename a file or directory
rmdir
Remove (or delete) an 
empty
 directory
rm
Remove (or delete) a file
Does 
not
 move files to a folder called “trash” or similar; deletes them
totally
, 
utterly
, and 
irrevocably!
 
9
 
USEFUL COMMANDS
 
man
Displays the instruction manual for a command
grep
Searches files for lines matching a given pattern
find
Search for files in a directory hierarchy
vi
, 
emacs
Text file editors
ls -al
List all files, including “hidden” files
 
10
 
USEFUL COMMANDS, CONT.
 
ssh
Secure shell connection to a remote client
We know this one already 
 (more secure than 
telnet
)
more
, 
less
Displays files one screenful at a time
diff
Prints the differences between two or more files
sort
Sorts lines of text files
strings
Prints the strings of printable characters in a file
 
11
 
WARGAMES: BANDIT
 
Exercises beginner command line usage and hacking skills
 
The goal of each level is to find the password for the next level
 
Often, this will involve finding the correct file, opening it, and reading the
contents
 
12
 
You get to play the hacker!
If you have no idea what you are supposed to do,
Don’t panic! Don’t give up!
Asking for help is encouraged (the instructor, a TA,
your neighbor)
 
BANDIT, CONT.
 
Navigate in your browser to:
https://overthewire.org/wargames/bandit
Read the instructions, then click the link for Level 0
We have already completed this level; click the link for Level 1
 
13
 
Read the instructions for hints on how to complete
each level
Use the listed commands
Try 
man
 
<command> 
or 
<command> --help
 for more
information
See how far you can get!
 
NEXT STEPS
 
Learn a programming language
Python
 is a great option 
 free, and lots of online tutorials
 
Try Linux on your own
Ubuntu 
is a great option 
 free, and lots of online support
 
Learn networking basics
Next week…
 
Learn cybersecurity basics
Third week…
 
 
14
 
Slide Note
Embed
Share

The significance of the command line interface in computing, understand why it is preferred for efficient file management, and discover Linux as an alternative operating system widely utilized on servers and supercomputers. Learn how to access a Linux server via SSH for practical application.

  • Linux
  • Command Line
  • Networking
  • Hacking
  • Operating System

Uploaded on Mar 13, 2024 | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Exceptional service in the national interest INTRO TO THE LINUX COMMAND LINE Networking Basics and Hacking Simulation Charles Reinke & Warren Davis Hands-on, Minds-on Technology (HMTech) 2023 Sandia National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia LLC, a wholly owned subsidiary of Honeywell International Inc. for the U.S. Department of Energy s National Nuclear Security Administration under contract DE-NA0003525.

  2. WHY COMMAND LINE? Text interface to your computer Referred to as the shell, terminal, console, or prompt Allows copy and paste of commands from other sources, such as a website Preferred interface for mainframes and supercomputers Compared with graphics, text is very light on resources 2

  3. WHY COMMAND LINE? Efficient file management and system maintenance Shell provides user commands and environment variables Shell scripting automates long shell commands to make complex tasks easier 3

  4. WHAT IS LINUX Alternative Operating System, like Windows or Macintosh Inspired by Unix Open source Only used on 2.6% of all desktop computers But, used on over 96% of webservers and 100% of the world's 500 fastest supercomputers! 4

  5. WHAT IS LINUX Alternative Operating System, like Windows or Macintosh Inspired by Unix Open source Only used on 2.6% of all desktop computers But, used on over 96% of webservers and 100% of the world's 500 fastest supercomputers! Also underpins ChromeOS (20% of all sub-$300 laptops) Android is Linux-based, making Linux the most-used general-purpose operating system! 5

  6. OPENING A COMMAND PROMPT Click the Windows button and type powershell Click on the Windows PowerShell app Prompt tells you the computer is ready to accept a command Not a Linux environment yet; we re still in Windows powershell 6

  7. CONNECTING TO A LINUX SERVER Type ssh Enter Enter If you get a Are you sure you want to continue connecting [ ] message, type yes yes and hit Enter Enter Enter bandit0 bandit0 for the password Now we are in a Linux environment! Let s try running some basic commands p 2220 and hit ssh bandit0@bandit.labs.overthewire.org bandit0@bandit.labs.overthewire.org p 2220 7

  8. BASIC LINUX COMMANDS Type pwd Case matters, PWD Prints out the shell s current working directory Try a few other commands: pwd and press the Enter or Return key PWD or Pwd Pwdwon t work ls ls Lists the contents of the a directory cd cd Allows you to change your current directory mkdir mkdir Make a new directory exit exit Closes the terminal Do you remember how to log back in? 8

  9. BASIC LINUX COMMANDS, CONT. echo echo Prints its arguments back out again cat cat Concatenate file contents (and print them out) mv mv Move or rename a file or directory rmdir rmdir Remove (or delete) an empty directory rm rm Remove (or delete) a file Does notmove files to a folder called trash or similar; deletes them totally, utterly, and irrevocably! 9

  10. USEFUL COMMANDS man man Displays the instruction manual for a command grep grep Searches files for lines matching a given pattern find find Search for files in a directory hierarchy vi, emacs emacs Text file editors vi ls ls - -al List all files, including hidden files al 10

  11. USEFUL COMMANDS, CONT. ssh ssh Secure shell connection to a remote client We know this one already (more secure than telnet) more, less less Displays files one screenful at a time more diff diff Prints the differences between two or more files sort sort Sorts lines of text files strings strings Prints the strings of printable characters in a file 11

  12. WARGAMES: BANDIT Exercises beginner command line usage and hacking skills The goal of each level is to find the password for the next level Often, this will involve finding the correct file, opening it, and reading the contents You get to play the hacker! If you have no idea what you are supposed to do, Don t panic! Don t give up! Asking for help is encouraged (the instructor, a TA, your neighbor) 12

  13. BANDIT, CONT. Navigate in your browser to: https://overthewire.org/wargames/bandit Read the instructions, then click the link for Level 0 We have already completed this level; click the link for Level 1 Read the instructions for hints on how to complete each level Use the listed commands Try man man<command> <command> or <command> <command> -- information See how far you can get! --help help for more 13

  14. NEXT STEPS Learn a programming language Python is a great option free, and lots of online tutorials Try Linux on your own Ubuntu is a great option free, and lots of online support Learn networking basics Next week Learn cybersecurity basics Third week 14

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#