SY110- Lab

Linux and Windows Operating Systems Lab Prep

Learning Outcomes

After completing these activities you should be able to:

  • Interact with the command line on both a Windows system (using PowerShell) and a remote Linux system (using SSH)
  • Understand terminology pertaining to commands, options, arguments, and file paths in a shell environment
  • Navigate a file system from the command line using absolute and relative paths
  • Identify and interpret shell output related to files, directories, permissions, and users
  • Create and inspect files and directories using common shell commands (e.g., touch, mkdir, ls)
  • Use shell help systems (--help, man) to explore command syntax and options
  • Gather basic system and process information using commands like uname and ps
  • Apply piping (|) to manipulate command output
  • Recognize permission-related errors and relate file permissions to concepts of confidentiality, integrity, and availability
  • Demonstrate how changes made through the command line are reflected in the graphical interface (and vice versa)



Terminal Shortcut Keys

The table below provides a quick reference to common keyboard shortcuts you may find helpful:

Shortcut Description
/
(Up / Down Arrow)
Scroll through previously entered commands. Useful for repeating or editing past commands.
/
(Left / Right Arrow)
Move the cursor left or right within the current command to make quick edits.
Tab Auto-complete file or directory names. Press twice to view suggestions if more than one match exists.
Ctrl + C Cancel the current command or stop a running process.
Ctrl + L Clear the screen (equivalent to typing clear).

Core Shell Commands and Symbols

This table includes commands and symbols that are essential for using the command line, many of which are introduced in this lab. You are expected to understand the basic purpose and usage of these items and should be prepared to apply or recognize them in future assessments.

Command/Symbol Summary Example Usage
pwd Prints the full path of the current working directory pwd
cd Changes the current working directory cd /home
ls Lists files and directories in the current directory ls -al
mkdir Creates a new directory mkdir lab_2
rmdir Removes an empty directory rmdir lab_2
cp Copies files or directories cp file.txt backup.txt
mv Moves or renames files or directories mv file.txt newfile.txt
rm Deletes files rm file.txt
cat Displays the contents of a file cat file.txt
whoami Shows the current logged-in user whoami
man Displays the manual page for a command; short help may also be available via --help option man ls
ps Shows current running processes ps -ef
ssh Connects to a remote system securely over the network ssh user@hostname
| Pipe operator: sends the output of one command as input to another ps -ef | grep sshd
~ Represents the current user’s home directory cd ~
. Represents the current directory ls .
.. Represents the parent directory (one level up) cd ..

Additional Commands & Symbols

This table includes additional commands that appear in the lab to support specific tasks (creating files, viewing system info, filtering output, etc.). These commands are useful to observe and use in context, but you are not expected to memorize or recall them independently for assessments.

Command/Symbol Summary Example Usage
grep Searches for a specific pattern or text within files or command output. NOTE: grep does not exist in Windows ps -ef | grep sshd
wc Counts lines, words, and characters in input text or files. NOTE: wc does not exist in Windows ps -ef | wc -l
uname Displays system information such as the operating system. NOTE: uname does not exist in Windows uname
exit Closes the current shell session exit
touch Creates an empty file or updates the timestamp of an existing one touch file.txt
echo Prints a message to the screen or into a file echo "Hello!"
>> Appends the output of a command to the end of a file echo "Hi there" >> notes.txt

Lab Assignment

The lab assignment for this activity is located in Blackboard.


Supplemental Media:

OverTheWire - Bandit

Gamification. Learn more about Linux command shells through OverTheWire's Bandit. USNA's very own Cyber Security Team (CST) utilizes this site to teach new members and gain experience using Linux shells!

Linux - The Origin Story


>