Tools of network analysts: using the CLI
Many network devices ship without a graphical interface — the CLI is their only configuration tool. Learning to navigate file systems, run commands, and transfer files securely using the command line is an essential skill for any network analyst.
What this topic covers
- › 4.3.A — CLI vs. GUI; navigating Linux and Windows file systems with commands
- › 4.3.B — SSH and SFTP for secure remote connections and file transfers
Why CLI over GUI?
CLIs allow simplified automation and repetition of tasks. They take up less storage space and use less processing power than GUIs, leaving more resources available for the device's actual tasks. Many routers, switches, and servers have no GUI at all — the CLI is the only way to configure them.
File system paths (4.3.A)
Understanding how paths work in Linux and Windows is fundamental to navigating the CLI effectively.
Linux paths
-
›
Paths start from the root directory:
/ -
›
Directories are separated by forward slashes:
/home/user/Desktop -
›
Tilde (
~) refers to the current user's home directory -
›
Dollar sign (
$) at the end of the prompt indicates the shell is ready for input
user@hostname /home/user/Desktop $
# ready for input in Desktop directory
user@hostname ~ $
# ready for input in home directory
Windows Command Prompt paths
-
›
Paths start with a drive letter:
C:\ -
›
Directories are separated by backslashes:
C:\Users\username\Desktop -
›
Right-angle bracket (
>) at the end of the path indicates the shell is ready for input
C:\Users\admin\Desktop>
REM ready for input in Desktop directory
Command syntax
All CLI commands follow a standard pattern: command → options → arguments
Command
The program to execute: ls, cd, ping
Options (flags/switches)
Modify behavior, denoted with a dash: -a, -r. Optional.
Arguments
Specify the target: a file name or directory path. Some commands require them; others don't.
ls # list current directory (no options or arguments)
ls -a # list current directory including hidden files
ls user1 # list user1 directory, excluding hidden files
ls -a user1 # list user1 directory including hidden files
Navigation commands
| Command | OS | Purpose |
|---|---|---|
| cd subdirectory | Mac/Linux/Windows | Move into a subdirectory of the current directory |
| cd .. | Mac/Linux/Windows | Move to the parent directory (one level up toward root) |
| cd ~ | Mac/Linux | Move to the current user's home directory |
| cd / | Mac/Linux | Move to the root directory |
| ls | Mac/Linux | List contents of the current (or specified) directory |
| dir | Windows | View contents of the current directory |
| pwd | Mac/Linux | Print the current working directory path |
| help / man | Both | Get help on a command — help for overview, man for detailed documentation |
Secure file transfer with SSH and SFTP (4.3.B)
SSH — Secure Shell
SSH is a protocol for securing remote CLI connections. It encrypts all data exchanged between the user and the remote device — including login credentials. SSH uses port 22.
SFTP — Secure File Transfer Protocol
SFTP runs over SSH to transfer files securely between devices. Because it uses SSH, all data and credentials are encrypted. SFTP also uses port 22.
# connect to remote host via SFTP
sftp panda@192.168.1.15
# nothing appears while typing password (security feature)
Inside an SFTP session
Navigate the remote device
-
ls— list contents of the current remote directory -
cd— change the remote directory -
pwd— view the current remote working directory
Transfer files
-
get filename— download a file from the remote device to the local device -
put filename— upload a file from the local device to the remote device