After completing these activities you should be able to:
touch, mkdir, ls)--help, man) to explore command syntax and optionsuname and ps|) to manipulate command outputThe 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). |
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 .. |
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 |