---
title: "AP Networking 4.3: Tools of Network Analysts: Using the CLI"
description: "Learn AP Networking 4.3, Tools of Network Analysts: Using the CLI, with a study guide that covers every learning objective in the topic and the skills it builds."
canonical: "https://fiveable.me/ap-networking/unit-4/tools-of-network-analysts-using-the-cli/study-guide/l4OV6bWnP1a7xJKCYmBY"
type: "study-guide"
subject: "AP Networking"
unit: "Unit 4 – Managing Our Global Connections"
lastUpdated: "2026-11-09"
---

# AP Networking 4.3: Tools of Network Analysts: Using the CLI

## Summary

Learn AP Networking 4.3, Tools of Network Analysts: Using the CLI, with a study guide that covers every learning objective in the topic and the skills it builds.

## Guide

If you've only ever clicked around a computer using icons and windows, the command line interface (CLI) can feel like stepping into a different world. Instead of pointing and clicking, you type commands as text and the system responds. Network analysts live in the CLI because it's fast, scriptable, and works on devices that don't even have a screen worth looking at. This guide walks through how to navigate systems with CLI commands and how to move files between machines securely.

## Why Network Analysts Use the CLI

A graphical user interface (GUI) can feel more intuitive because you can see buttons, folders, and menus. But a **command line interface (CLI)** has real advantages that matter for network work:

- **Automation and repetition.** You can save a series of CLI commands in a script and run them again and again. Try automating a GUI by clicking in the exact same spot a thousand times. Not fun.
- **Small footprint.** A CLI uses less storage space and less processing power than a GUI. That leaves more resources for the user's actual tasks, apps, and files.
- **Device compatibility.** Many network devices (routers, switches, servers) only offer a CLI. There is no GUI option, so you have to know your way around.

That last point is big. If you're configuring a router in a server room, there's no desktop with pretty folders. It's you and a blinking cursor.

## Reading a CLI Prompt

Before you type any command, you need to know how to read the **prompt**, which is the text the system shows to tell you it's ready for input.

### Linux prompts

On Linux-based systems, file locations often start at the **root directory**, written as `/`. Every other folder is nested inside root. So a path like `/home/user/Desktop` means:

- `home` sits inside `/` (root)
- `user` sits inside `home`
- `Desktop` sits inside `user`

A typical Linux prompt looks like this:

```
user@hostname /home/user/Desktop $
```

A few things to notice:
- The `$` at the end signals the prompt where you type your command. Many modern shells use this symbol.
- The path shows your current location in the file system.
- The **tilde** (`~`) is a shortcut for the current user's home directory. So `user@hostname ~ $` means you're sitting in your own home folder.

### Windows prompts

**Command Prompt** is the proprietary CLI for Windows. Its paths begin with a drive letter, then the nested directory names, like `C:\Users\username\Desktop`. Here:

- `Users` is inside the `C:` drive
- `username` is inside `Users`
- `Desktop` is inside `username`

A Windows prompt uses a right-angle bracket (`>`) after the path to show it's ready for input:

```
C:\Users\user\Desktop>
```

### Absolute vs. relative paths

A path like `/home/user/Desktop` is **absolute** because it starts from the root and tells the system exactly where to look. A path like `Desktop` by itself is **relative**, meaning it's interpreted from your current location. If you're already in `/home/user`, typing `Desktop` tells the system to look for `Desktop` inside `/home/user`.

## CLI Command Syntax

Every CLI command follows a standard syntax pattern:

```
command options arguments
```

- **Command:** the name of the program you want to run (like `cd` or `ls`).
- **Options:** optional parameters that change how the command behaves or what it shows. They're often marked with a dash (`-`) and are also called **switches** or **flags**.
- **Arguments:** specific info the command needs, like a file name or path. Some commands require arguments, others run fine without any.

The Linux `ls` command (which lists what a directory contains) shows all four combinations:

| Command | What it does |
|---|---|
| `ls` | No options, no arguments. Lists the contents of your working directory, excluding hidden files. |
| `ls -a` | Option `-a` shows everything in the working directory, hidden files and directories included. |
| `ls user1` | No options, with `user1` as the argument. Shows what the `user1` directory holds, excluding hidden files. |
| `ls -a user1` | Both the `-a` option and the `user1` argument. Shows everything in `user1`, hidden files included. |

## Navigating the File System

To get work done in a CLI, you need to do three basic things: move between directories, see what a directory contains, and figure out where you currently are.

### Core navigation commands

| Command | System | What it does |
|---|---|---|
| `cd` | Mac/Linux/Windows | Changes the working directory |
| `ls` | Mac/Linux | Lists what a directory contains |
| `dir` | Windows | Shows what a directory contains |
| `pwd` | Mac/Linux | Prints the current working directory |

The `ls` vs `dir` split trips people up. On Mac or Linux, you list contents with `ls`. On Windows, the same job is done by `dir`.

### Using cd to move around

The `cd` command (change directory) is the main way to move through a file system. A few useful versions:

- `cd subdirectory_name`: moves you into a subdirectory of your current location.
- `cd ..`: moves you one level up, toward the root directory.
- `cd ~`: jumps to your home directory.
- `cd /`: jumps all the way to the root directory.

So if you're sitting in `/home/user/Desktop` and type `cd ..`, you'll land in `/home/user`. Type it again and you're in `/home`. One more and you're at `/`.

### Getting help with commands

When you forget how a command works (and you will), two commands bail you out:

- `help`: gives a general overview of a command.
- `man`: short for "manual," gives detailed documentation on a command's options and usage.

Use `help` when you want a quick refresher. Use `man` when you need the full breakdown.

## Moving Files Securely Between Systems

Network analysts don't just manage one machine. They often need to transfer files between devices, and those transfers need to be [secure](/ap-networking/networking-skills/secure/study-guide/tbJ0w0h0YOeV6KgATgfF "fv-autolink"). The CLI handles this through two related protocols.

### SSH: the secure foundation

**Secure Shell (SSH)** is a CLI protocol for connecting securely to remote systems. The key word is *secure*. SSH encrypts all data that travels in either direction between you and the remote device. That means anyone snooping on the network just sees scrambled gibberish.

### SFTP: secure file transfer built on SSH

**Secure File Transfer Protocol (SFTP)** is one option for moving data between devices. SFTP relies on SSH to set up the secure connection, so every bit of data (login credentials included) stays encrypted during the transfer.

Both SSH and SFTP operate on **port 22**. If someone asks what port SFTP uses, the answer is the same as SSH: 22.

### Starting an SFTP session

To open an SFTP session, you connect to the remote host with this command:

```
sftp <remote_username>@<remote_hostname_or_IP_address>
```

For example:

```
sftp panda@192.168.1.15
```

This tries to reach user `panda` on the device at IP address `192.168.1.15`. The connection isn't complete until you supply valid credentials. For security, the password stays invisible as you type it. No asterisks, no dots, nothing. That's normal, not a bug.

### Navigating inside an SFTP session

Once you're connected, you can move around the remote device using commands that look just like the local ones:

- `ls`: shows what the current remote directory contains.
- `cd`: switches to a different remote directory.
- `pwd`: displays which remote directory you're currently in.

The commands feel familiar, but remember they're acting on the *remote* device now, not your local machine.

### Transferring files with get and put

The two main commands for moving files during an SFTP session:

- `get filename`: downloads a file from the remote device to your local device.
- `put filename`: uploads a file from your local device to the remote device.

An easy way to keep them straight: you **get** things *from* the remote server (remote to local), and you **put** things *onto* the remote server (local to remote).

So if you're connected to a web server and want to grab a log file to analyze locally, you'd use `get server.log`. If you want to upload a new config file, you'd use `put new_config.txt`.

## Vocabulary

- **Command Line Interface**: A text-based environment in which users type commands to perform tasks such as system management and file transfers.
- **SFTP session**: An interactive connection to a remote device opened with the sftp command, within which file navigation and transfer commands are used.
- **Secure File Transfer Protocol**: A method for moving data between devices that relies on SSH to set up a secure, encrypted connection during transfer.
- **Secure Shell**: A CLI protocol for connecting securely to remote systems, encrypting all data sent in either direction between user and remote device.
- **cd**: An SFTP command that switches to a different remote directory.
- **encryption**: The process of converting data into a coded form so that only authorized parties with the proper key can read it.
- **get filename**: An SFTP command that downloads a file from the remote device to the local device.
- **login credentials**: The username and password used to access a device's configuration or management interface.
- **ls**: An SFTP command that shows the contents of the present remote directory.
- **port 22**: The network port used by both SSH and SFTP for their connections.
- **put filename**: An SFTP command that uploads a file from the local device to the remote device.
- **pwd**: An SFTP command that displays the current remote working directory.
- **remote host**: The target device or system that a user connects to over a network, identified by a hostname or IP address.

## About This Document

Canonical Fiveable pages are available as Markdown at the same path plus `.md`.

- [llms.txt](https://fiveable.me/llms.txt): index of Fiveable's sections and URL patterns
- [llms-full.txt](https://fiveable.me/llms-full.txt): complete subject and unit listing
- [MCP server](https://fiveable.me/mcp): call Fiveable as tools instead of fetching pages (`https://fiveable.me/api/mcp`)
- [MCP server for AP teachers](https://fiveable.me/mcp/teachers): a teacher's classes, assignments and AP-rubric grading (`https://fiveable.me/api/mcp/teacher`)
