HMTech Command Line2
HMTech Command Line2
HMTech Command Line2
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.
WHY COMMAND LINE?
2
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
WHAT IS LINUX
4
WHAT IS LINUX
5
OPENING A COMMAND PROMPT
6
CONNECTING TO A LINUX SERVER
7
BASIC LINUX COMMANDS
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
• 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
BANDIT, CONT.
13
NEXT STEPS
14