Skip to main content
← Unit 4: Managing Our Global Connections

Code Scholars Tutoring · AP Networking

Working at the Command Line

Further study for framework topic 4.3.

How it works

Command-line tools report what the network is actually doing rather than what a diagram says it should. Their output is evidence, and reading it accurately is a skill in itself.

Run the tool that answers the question you are asking, then read the whole output rather than the last line. Intermediate results often carry the finding.

Common error

Absence of a reply is not always failure. Knowing which non-answers are normal prevents a lot of wasted investigation.

Topic 4.3: CLI navigation, remote sessions, and secure file transfers

A command line is useful when you need to identify your current context, repeat a task, inspect a remote system, or transfer a specific file. Practice those skills through a fictional museum media-display maintenance task: retrieve a playback log and place an approved caption file in a staging directory. Distinguish the terminal, shell, machine, account, and working directory before interpreting a command. All names, paths, and transcripts below are learning examples; the lab hostname is not a real service to contact.

Read topic 4.3 notes, examples, and quick checks

4.3.A: Choose a text interface for a specific task

A graphical user interface presents controls visually; a command-line interface accepts textual instructions and displays results. A CLI can make a well-defined task easy to repeat or automate and can support devices with limited resources or no attached display. A GUI can make discovery and inspection convenient. Many servers and network devices support both, while some expose only selected interfaces. Typing is not automatically more correct: repeatable commands also repeat mistakes unless the target, inputs, permissions, and results are checked.

Distinguish the terminal from the command interpreter

A terminal application hosts an interactive session. The shell or command interpreter parses what you type and runs built-ins or programs. A terminal can host Bash, another Unix-like shell, Windows Command Prompt, PowerShell, or an SSH-connected remote shell. An interactive SFTP client has its own command vocabulary. Identify which interpreter is active; a familiar word such as ls or cd can mean different things or accept different options in different contexts.

Read the account, host, location, and current session

In the illustrative Bash prompt riley@media-desk:~$, riley is the local account, media-desk the computer, and ~ abbreviates that account's home directory. A prompt appears when the interpreter is ready for another command. Prompt formats are configurable: a dollar or hash symbol is a convention, not independent proof of privilege or identity. After SSH login, check the changed host/account and confirm the directory with pwd. At sftp>, use its local and remote location commands rather than assuming you are in a normal shell.

Resolve an absolute or relative path in the right environment

A Unix-style absolute path begins at /, such as /srv/display/reports. A relative path such as reports is interpreted from the current working directory. The root directory / is a location, not the same thing as the root administrative account. In Bash, unquoted ~ expands to the current account's home; it is not a literal subdirectory named tilde. Windows drive-qualified paths use a different notation. The same relative text can identify different locations on the local computer and the remote server.

Use cd, pwd, dot, and parent paths deliberately

In a Unix-like shell, pwd reports the working directory, cd changes it, . refers to the current directory, and .. to its parent. cd .. moves one level up; cd / goes to the filesystem root; cd ~ returns to the account's home in Bash. A directory is not a document to open with cd. If a path is missing, compare the current directory, spelling, case, and expected filesystem. Case behavior depends on the filesystem, so do not assume every platform treats names identically.

List what is present, including relevant hidden entries

In the Bash-style examples, ls lists ordinary visible names in the current directory, and ls -a includes dot-prefixed entries. A path argument lets you inspect another directory without changing into it. The entries . and .. name the current and parent directories; a dot-prefixed file is not encrypted or access-protected merely because it is usually hidden from the default listing. Windows Command Prompt uses dir and its own switches; PowerShell provides Get-ChildItem and supports different parameter conventions.

Separate the command, options, and operands

In ls -a "/home/riley/Museum Media", ls is the command, -a changes its listing behavior, and the quoted path is one operand identifying what to list. Many instructions can be explained with this pattern, but a shell built-in is not necessarily an external program and each command defines its own accepted syntax. Some options take values; others do not. Do not assume that the same letter has the same meaning for another program or that a command requires an operand in every use.

Keep paths with spaces together using the interpreter's rules

Without appropriate quoting, a shell can split Museum Media into separate words. In the Bash examples, cd "Museum Media" treats it as one relative directory name. Quotes group the path; they are not part of the stored directory name. Expansion rules also matter: in Bash, quoting "~/Museum Media" prevents the normal leading-tilde expansion. Use the documented absolute path, a correctly quoted home-variable path, or an appropriate relative path. Syntax copied from one interpreter may need adjustment in another.

Ask the active environment how its command works

For Bash built-ins, help cd or help pwd can explain the shell's own implementation. man ls opens an installed manual page where available; a typical manual pager uses q to exit. Command Prompt supports help dir and dir /?, while PowerShell uses Get-Help with the appropriate command name. Inside an SFTP session, help lists that client's commands. Manual availability and output can vary with the installation. Read the help for the actual interpreter and version rather than applying an unfamiliar option by analogy.

Keep Command Prompt and PowerShell examples distinct

In Windows Command Prompt, cd without an operand displays the current directory, dir lists entries, and dir /b requests a bare listing. cd /d "D:\Museum Media\downloads" changes both the drive and directory. A fully qualified D:\path is different from the drive-relative D:path form. PowerShell uses Get-Location, Set-Location, and Get-ChildItem; aliases such as pwd, cd, ls, or dir may point to these commands. A Windows terminal window does not by itself establish which interpreter is running.

Use an error to check context before changing access

No such file or directory suggests checking the actual side, location, spelling, and path. Not a directory can mean cd was given a file. An unrecognized command can mean the wrong interpreter or an unavailable program. Permission denied can refer to local files, remote files, or authentication depending on where it appears. Record the exact step and relevant output. A refused operation is not a reason to grant broad permissions or change a whole system; first identify the intended account, path, and approved task.

4.3.B: Use SSH for an authorized remote session

SSH provides a protected transport for remote access, commonly on TCP 22. ssh mediaops@display-hub.media.test requests the named account on the named host; after successful authentication, an interactive shell may run there if that account is allowed one. The account can instead be restricted to particular operations. In an interactive remote shell, ordinary commands such as pwd, cd, and ls affect the remote context. exit closes that shell and returns to the prior local session. Connecting does not copy all remote files to the laptop.

Verify the server and use the approved account authentication

SSH host identity and user authentication answer different questions: which server is this, and is the account allowed to log in? Check a new or changed host key through an approved trusted record rather than bypassing the warning. User authentication may use a password, a key, or other configured methods. An ordinary password prompt often shows no characters while typing. Protected transport does not hide every network metadata item or secure the endpoints themselves. The examples assume the host has been verified and approved authentication completed; they include no real secrets.

Use SFTP as a file-transfer interpreter over SSH

SFTP transfers and manages files through the SSH transport, commonly using the same TCP 22 service. It is distinct from FTP and FTPS. A client such as sftp mediaops@display-hub.media.test enters an interactive sftp> prompt after the required connection and authentication. That prompt accepts SFTP commands, not arbitrary Bash commands. The account needs appropriate file access; it does not necessarily need an unrestricted shell. Remote paths can be restricted to a configured server view, so do not assume a directory seen through SFTP matches every system's global filesystem.

Track SFTP local and remote working directories independently

In the SFTP client used here, pwd, cd, and ls operate remotely, while lpwd, lcd, and lls inspect or change the client's local context. Changing the remote directory does not change the local destination for a download. Changing the SFTP client's local directory also does not move the parent shell after the client exits. The local starting directory normally comes from the shell that launched the client, and the remote starting location comes from server configuration. Confirm both rather than assuming they are the same.

Read transfer direction from the client's point of view

get remote-file downloads from the remote side into the SFTP client's local directory, unless an explicit local destination is given. put local-file uploads from the local side to the remote working directory or explicit remote destination. Both operations can use a different destination name. Confirm the intended filename, source, target, and any existing destination before transfer because a copy can replace content. A correct direction with a wrong working directory can still fetch or overwrite the wrong file.

Check each program's option syntax, including letter case

With the clients shown here, ssh -p 2222 selects a nondefault SSH port, while sftp -P 2222 selects a nondefault SFTP/SSH service port. These are alternative syntax examples for an approved service that actually uses that port; the main fictional lab uses the ordinary default. Option names are program-specific and case-sensitive. Also check the host, account, and the active interpreter before copying a command. Selecting a different port does not authorize an account or verify the host identity.

Verify the correct copy and distinguish staging from activation

Use directory and file checks to confirm the downloaded log is in the intended local folder and the caption file reached the approved remote incoming directory. Where the workflow requires it, compare trusted checksums or the expected content and obtain the service's acknowledgment. A completed transfer does not itself prove that a display application accepted, parsed, or activated a new caption. This example stages an approved file for separate review; no service restart or live configuration change is part of the transfer task.

Make repeatability depend on clear preconditions and results

A saved command sequence can reduce repeated typing, but its account, machine, starting paths, interpreter, inputs, and permissions must be understood. Relative paths can behave differently when a scheduled job starts elsewhere. Suitable automation records failures and verifies results rather than assuming that reaching the final line proves success. Keep credentials in the approved authentication arrangement instead of embedding passwords or private-key contents in a script or shared note. Begin with a small controlled task before repeating it broadly.

Audit an AI suggestion by context, direction, and expected effect

Read each proposed instruction against the actual shell or SFTP prompt, local and remote locations, intended source, destination, options, and account permissions. Ask which step reads or changes which side. An AI can confuse cd with lcd or use flags from another interpreter even when the filename looks right. Preserve useful parts, correct the specific mismatch, and verify the final file. A suggested permission expansion or host-verification bypass does not resolve an unexplained context error.

Read the prompt, resolve the path, and prove transfer direction

Bash-style local navigation with a directory containing a space
riley@media-desk:~$ pwd
/home/riley
riley@media-desk:~$ ls -a "Museum Media"
.  ..  .session-note  downloads  uploads
riley@media-desk:~$ cd "Museum Media"
riley@media-desk:~/Museum Media$ pwd
/home/riley/Museum Media
riley@media-desk:~/Museum Media$ cd downloads
riley@media-desk:~/Museum Media/downloads$ pwd
/home/riley/Museum Media/downloads
riley@media-desk:~/Museum Media/downloads$ cd ..
riley@media-desk:~/Museum Media$ cd /
riley@media-desk:/$ pwd
/
riley@media-desk:/$ cd ~
riley@media-desk:~$ pwd
/home/riley

This is an illustrative Bash prompt, not text to type in full. The quotes keep Museum Media together. Listing that directory did not change the working directory; cd did. Dot-prefixed .session-note appears with -a, while . and .. refer to the current and parent directories. The final cd ~ returns to this lab account's stated home.

Independent Windows examples: Command Prompt and PowerShell
Windows Command Prompt — separate example filesystem

C:\Users\Riley>cd /d "D:\Museum Media\downloads"
D:\Museum Media\downloads>cd
D:\Museum Media\downloads
D:\Museum Media\downloads>dir /b
playback-16.log

PowerShell — a separate session

PS C:\Users\Riley> Get-Location
Path
----
C:\Users\Riley
PS C:\Users\Riley> Set-Location -LiteralPath 'D:\Museum Media\downloads'
PS D:\Museum Media\downloads> Get-ChildItem -Name
playback-16.log

The Command Prompt /d switch changes the drive as well as the directory. PowerShell uses its own command names and parameters; its ls, dir, and pwd aliases do not make every Unix or Command Prompt option interchangeable. These independent Windows paths are not the Linux home paths used in the transfer lab.

Dissect a command and ask the active interpreter for help
Bash-style command:
  ls -a "/home/riley/Museum Media"

Command name:  ls
Option:        -a
Path operand:  /home/riley/Museum Media (one quoted operand)

Help in the relevant context:
  Bash built-in help:      help cd
  Installed manual:        man ls
  Command Prompt help:     help dir
  Command Prompt options:  dir /?
  PowerShell help:         Get-Help Get-ChildItem
  At the SFTP prompt:      help

If an approved server instead uses port 2222:
  ssh -p 2222 mediaops@display-hub.media.test
  sftp -P 2222 mediaops@display-hub.media.test

These are separate syntax/help examples, not one script for a single interpreter. The default transfer lab uses the usual service port and does not require the alternative 2222 settings. Check option spelling and case in the actual client. A manual pager commonly uses q to return; an interactive SFTP session uses bye or another supported exit command.

SSH inspection: remote commands, then a return to the local shell
Precondition: host identity verified and approved authentication used.
Authentication and connection-banner details are omitted.

riley@media-desk:~$ ssh mediaops@display-hub.media.test
mediaops@display-hub:~$ pwd
/home/mediaops
mediaops@display-hub:~$ cd /srv/display/reports
mediaops@display-hub:/srv/display/reports$ pwd
/srv/display/reports
mediaops@display-hub:/srv/display/reports$ ls
playback-17.log
mediaops@display-hub:/srv/display/reports$ exit
Connection to display-hub.media.test closed.
riley@media-desk:~$ pwd
/home/riley

The changed host/account identifies the illustrated remote context, and pwd confirms its actual working directory. The remote cd does not move the local shell. This account is permitted this inspection in the fictional lab; other accounts may be restricted to SFTP. SSH protects the session but does not automatically download the listed file or establish that its contents were reviewed.

SFTP: local and remote directories are independent
Precondition: approved host verification/authentication completed.
All listed directories exist and have the documented task permissions.
Transfer progress output is omitted.

riley@media-desk:~$ sftp mediaops@display-hub.media.test
Connected to display-hub.media.test.
sftp> lpwd
Local working directory: /home/riley
sftp> pwd
Remote working directory: /home/mediaops
sftp> lcd "/home/riley/Museum Media/downloads"
sftp> cd /srv/display/reports
sftp> ls
playback-17.log
sftp> get playback-17.log
Fetching /srv/display/reports/playback-17.log to playback-17.log
sftp> lcd "/home/riley/Museum Media/uploads"
sftp> cd /srv/display/incoming
sftp> put captions-v3.txt
Uploading captions-v3.txt to /srv/display/incoming/captions-v3.txt
sftp> ls
captions-v3.txt
sftp> bye
riley@media-desk:~$ pwd
/home/riley
riley@media-desk:~$ ls "/home/riley/Museum Media/downloads"
playback-17.log

get reads the remote reports file and writes into the selected local downloads folder. put reads the local uploads file and writes into the selected remote incoming folder. Both use the current locations shown by this client; explicit destination paths can change that. After bye, the parent shell remains at /home/riley: the SFTP client's lcd did not change the parent shell's directory. File presence is one check; the required content and staging acknowledgment still need verification.

Correct a local-versus-remote path error without broad permission changes
Independent SFTP diagnosis

Current local directory (lpwd): /home/riley
Current remote directory (pwd): /srv/display/incoming
Local approved caption source:
  /home/riley/Museum Media/uploads/captions-v3.txt

An AI draft uses:
  cd "/home/riley/Museum Media/uploads"
  put captions-v3.txt

Observed result:
  Remote directory change fails: that path is not in the server view.
  Relative local upload source is not found in /home/riley.

Precise corrected sequence at sftp>:
  lcd "/home/riley/Museum Media/uploads"
  cd /srv/display/incoming
  put captions-v3.txt
  ls

Required verification:
  Correct local source and remote staged copy agree.
  Destination is the approved incoming directory.
  Application review/activation is still separate.

cd tried to change the remote directory, while the needed source was local. The failed remote change did not alter the SFTP client's local starting directory. Fix that context with lcd, keep the approved remote staging path, and upload with put. If a genuine permission denial remains, review the intended account and directory rights instead of treating a path error as a reason to grant access everywhere.

Retrieve a playback log and stage an approved caption file

  1. 1Identify the interpreter, account, and host

    Confirm the local shell and starting directory, the approved remote account and host identity, and whether the task needs a shell session, a file-transfer session, or both.

  2. 2Confirm the source and destination records

    Locate the intended remote reports file and local caption source. Record the exact local downloads/uploads paths and approved remote incoming directory, including spaces and case.

  3. 3Use a remote shell only for the approved inspection

    If permitted, connect with SSH, inspect the remote context with pwd and the documented path, then exit. Verify that the local prompt and location return as expected.

  4. 4Open SFTP and inspect both contexts

    Complete the approved connection/authentication, then use lpwd for the local side and pwd for the remote side. Use the SFTP client's help if command behavior is uncertain.

  5. 5Download the log into the intended local folder

    Set the local downloads folder with lcd, move remotely to the reports directory with cd, confirm the source listing, and use get for the required log.

  6. 6Upload the caption to the intended staging folder

    Set the local uploads folder with lcd, set the remote incoming folder with cd, confirm the source and destination, and use put. Keep the existing application activation process separate.

  7. 7Verify the copies and close the session

    Check the intended files and required content/checksum or workflow acknowledgment, then use bye to close SFTP. Back in the local shell, confirm the actual local path and record the task result and remaining review.

Identify the active interpreter before choosing commands
EnvironmentShow location / listChange directoryHelp and syntax note
Bash-style Unix shellpwd; ls; ls -a includes dot-prefixed entries.cd path; cd ..; cd /; cd ~ in Bash.help for appropriate built-ins; installed man pages where available. Quote space-containing paths correctly.
Windows Command Promptcd with no operand; dir; dir /b for bare names.cd path; cd ..; cd /d "D:\path" for a drive-and-directory change.help dir or dir /?; switches are defined by each command.
PowerShellGet-Location; Get-ChildItem; -Force for relevant hidden entries.Set-Location -LiteralPath with the intended path.Get-Help with the command name; aliases do not make other shells' flags interchangeable.
Interactive SFTP client used herepwd/ls remote; lpwd/lls local.cd remote-path; lcd local-path.help for the client vocabulary; this prompt is not an unrestricted remote shell.
Interpret the step and context of an error
ObservationLikely question to investigateAppropriate next check
A relative directory cannot be found.Is the working directory, side, spelling, or case different from the plan?Read pwd or lpwd in the active interpreter and compare with the exact intended path.
cd is given a document path and reports not a directory.Was a file confused with a container directory?List its parent and choose the intended directory or file operation.
A command or option is not recognized.Is the wrong interpreter active, or is that program/option unavailable?Identify the shell/client and use its help and installed tools.
SSH authentication fails.Are the host, account, approved authentication method, and server access correct?Check the intended connection and relevant authorized access records; do not put secrets into a shared transcript.
A new or changed SSH host key is reported.Does the presented server identity match the approved one?Verify through the trusted record and responsible support path; do not bypass identity checks to resolve an unrelated file task.
get or put reports a file or permission problem.Which side is the source, and which side is the destination?Inspect local/remote paths and task permissions separately; preserve evidence of the exact failing step.
Transfer completes but the display still shows old captions.Was the file only staged, or did the app accept and activate it?Verify the staged content and the separate approved application workflow rather than repeating uploads blindly.
Navigation commands in the stated Bash lab
Starting location / purposeCommandResulting location or effectReason
/home/riley · show locationpwdPrints /home/riley.Reports the location without moving.
/home/riley · inspect media directoryls -a "Museum Media"Lists that directory, including .session-note; stays in /home/riley.A listing operand is not a directory change.
/home/riley · enter media directorycd "Museum Media"/home/riley/Museum MediaOne quoted relative directory name.
/home/riley/Museum Media · enter downloadscd downloads/home/riley/Museum Media/downloadsA relative subdirectory.
/home/riley/Museum Media/downloads · move upcd ../home/riley/Museum MediaOne parent level.
/home/riley/Museum Media · jump to rootcd //An absolute root path.
/ · return to homecd ~/home/rileyThis Bash account's home expansion.
/srv/display/reports · return to remote homecd /home/mediaops/home/mediaops in that remote shell.Absolute path in the remote machine's stated layout, not a local movement.
SFTP directions and directory commands from the client perspective
Command at sftp>Side or directionUse in the labLimit
pwdRemoteRead the server working directory.Does not reveal the local destination folder.
lpwdLocalRead the client working directory.Does not change either directory.
ls / llsRemote listing / local listingConfirm the expected remote or local filename.A listing alone does not validate file contents or app activation.
cd remote-pathRemoteSelect /srv/display/reports or incoming.Does not choose the local download folder.
lcd local-pathLocal clientSelect the local downloads or uploads folder.Does not move the remote side or the parent shell after exit.
get remote-file [local-target]Remote -> localRetrieve playback-17.log.Confirm the intended source and existing local target before copying.
put local-file [remote-target]Local -> remoteStage captions-v3.txt in incoming.Confirm the intended source, remote destination, and task permission.
byeClose SFTPReturn to the prior local shell.Does not itself prove that the app consumed a staged upload.

Keep shell context and file-transfer direction explicit

The top pair compares the local shell with the SSH remote shell. The lower pairs describe the SFTP download and upload tasks from the client's perspective. The local ~ notation in the boxes abbreviates /home/riley for this fictional lab; full paths are listed below. Lines show the stated session or copy relationship, not physical network cables, automatic file activation, or one shared working directory.

The top pair compares the local shell with the SSH remote shell. The lower pairs describe the SFTP download and upload tasks from the client's perspective. The local ~ notation in the boxes abbreviates /home/riley for this fictional lab; full paths are listed below. Lines show the stated session or copy relationship, not physical network cables, automatic file activation, or one shared working directory. SSH connects the local riley account context on media-desk with the allowed mediaops shell on display-hub. SFTP get copies the remote reports file to local downloads. SFTP put copies the local caption source to remote incoming. The corresponding local and remote working directories remain independent.SSH remote sessionget: remote → localput: local → remoteLocal shellriley@media-desk/home/rileySSH remote shellmediaops@display-hub/home/mediaopsLocal download dir~/Museum Media/downloadsReceives playback-17.logRemote reports/srv/display/reportsSource playback-17.logLocal upload dir~/Museum Media/uploadsSource captions-v3.txtRemote incoming/srv/display/incomingReceives captions-v3.txt

Legend: the top relationship is an SSH session; lower line labels explicitly show copy direction. get is remote to local; put is local to remote. All accounts, files, and paths are fictional, and the lab hostname requires its own configured environment.

The approved fictional path and account record
RoleFull path or identityIntended task
Local account and computerriley on media-desk; home /home/riley.Launch the appropriate local shell and client.
Remote account and hostmediaops on display-hub.media.test; shell home /home/mediaops.Use verified host identity and the approved account; lab has a permitted shell and SFTP service.
Local download destination/home/riley/Museum Media/downloads/playback-17.logReceive the specific remote report with get.
Remote report source/srv/display/reports/playback-17.logRead and retrieve the authorized playback log.
Local caption source/home/riley/Museum Media/uploads/captions-v3.txtRead the approved local file for upload.
Remote staging destination/srv/display/incoming/captions-v3.txtReceive the file with put; application review and activation remain separate.

CLI navigation and secure transfer vocabulary

CLI and GUI
Text-command and graphical interfaces used to perform tasks; choose from the task and supported environment.
Terminal and shell
The interactive session host and the interpreter that parses commands; a terminal can host several different interpreters.
Prompt
A configurable display indicating the current interactive context and readiness, not independent proof of identity or privilege.
Working directory
The current location used to resolve relevant relative paths in a process or session.
Absolute and relative path
A path rooted in the relevant filesystem and a path interpreted from the current working location.
Root and home
The top directory / in the Unix-style lab and an account's personal starting directory; neither term automatically means an administrative privilege.
Dot, parent, and hidden entry
. means current directory, .. its parent, and dot-prefixed names are normally omitted by a basic Unix-style listing.
Command, option, and operand
The selected operation, its behavior modifiers, and the specific path or value it acts on.
Quoting
Interpreter-specific grouping and expansion rules that let a path containing spaces be passed as the intended operand.
Built-in and external program
An operation implemented by the interpreter itself and a separately invoked executable; their help and behavior can differ.
Command Prompt and PowerShell
Different Windows interpreters with different command/parameter conventions, even when some familiar names overlap.
SSH
Protected remote-access transport and tools, commonly using TCP 22, with distinct server-identity and account-authentication checks.
Host key and account authentication
Evidence of the server identity and the method used to establish the connecting account's identity; server policy controls which actions are permitted.
SFTP
File-transfer operations over SSH with a separate interactive client vocabulary; distinct from FTP and FTPS.
Local and remote SFTP context
The client and server working directories, inspected with lpwd and pwd and changed with lcd and cd in the stated client.
get and put
Downloads from remote to local and uploads from local to remote, interpreted from the file-transfer client's perspective.
Staging and activation
Delivering a file to an approved incoming location and the separate application workflow that accepts or uses it.
Repeatable verified task
A sequence whose interpreter, targets, starting locations, inputs, rights, failure handling, and intended results are understood.

Worked review: cd targets the server while the upload source is local

A technician must stage captions-v3.txt on a museum media-display host. The SFTP client starts locally in /home/riley and remotely in /srv/display/incoming. The approved source is in the local Museum Media/uploads directory. An AI draft treats that local path as a remote cd destination.

  • lpwd reports /home/riley, and pwd reports /srv/display/incoming. These describe different machines or filesystem views.
  • The draft uses cd "/home/riley/Museum Media/uploads". The remote server does not expose that local path, so the remote directory change fails.
  • The next relative put captions-v3.txt still looks for its source in the local SFTP working directory /home/riley, where that file is absent.
  • The approved account can write the intended incoming directory. No evidence supports a general permission expansion or host-identity bypass.
  • lcd to the intended local uploads folder, confirmation of the remote incoming path, and put stage the correct file. Required content and destination checks pass; application activation remains a separate approved step.

Reasoning: The command is syntactically plausible but operates on the wrong side. The remote cd failure does not move the local client, so the following relative source also fails. Identify the interpreter and both working directories first, then use lcd for the local source folder and cd for the remote destination. Keep the correct upload direction and the approved account rights. File-copy success addresses the staging task, not whether the display has activated new content.

  1. Record the SFTP context, lpwd, pwd, exact local source, approved remote destination, and failing step.
  2. Correct the local working directory with lcd and confirm the intended remote incoming directory with cd and pwd.
  3. Confirm the source file and existing target, upload with put, and verify the intended staged content and destination.
  4. Close with bye, confirm the local shell context, and record the transfer result without claiming automatic application activation.

Quick checks

Choose a question, form your answer, then open it to compare your reasoning.

1. Why can a CLI be useful for repeated maintenance tasks?

A defined command sequence can be recorded and repeated or automated. Correct targets, inputs, permissions, failure handling, and verification are still needed; repetition alone does not make a command correct.

2. Does opening a terminal prove that Bash is the active interpreter?

No. A terminal can host different shells, Command Prompt, PowerShell, a remote session, or another interactive program such as SFTP. Identify the current context before choosing syntax.

3. In riley@media-desk:~$, what do the account, host, and tilde identify?

The illustrated account is riley, the computer is media-desk, and ~ abbreviates /home/riley in this lab. Prompts are configurable and do not independently prove privilege.

4. What is the difference between / and the root administrative account?

/ is the Unix-style filesystem root location. The root account is a privilege/identity concept; navigating to / does not make the user an administrator.

5. From /home/riley, what does cd "Museum Media" select?

The relative directory /home/riley/Museum Media. The quotes keep the space-containing name together as one path operand.

6. From /home/riley/Museum Media/downloads, where does cd .. lead?

To /home/riley/Museum Media, one parent directory. It does not jump directly to / or automatically to the account home.

7. In the stated Bash lab, how do cd / and cd ~ differ?

cd / selects the filesystem root. cd ~ selects this account's home, /home/riley, through normal unquoted tilde expansion.

8. Does ls -a "Museum Media" move the shell into that directory?

No. It lists the specified directory, including relevant hidden entries, while leaving the working directory unchanged.

9. Is a dot-prefixed file protected from unauthorized reading merely because the basic listing hides it?

No. Hidden-name conventions and access permissions are different. ls -a can show the entry, while actual file access still depends on the applicable rights.

10. In ls -a "/home/riley/Museum Media", identify the command, option, and path operand.

ls is the command, -a is the option, and /home/riley/Museum Media is one quoted path operand. Each command defines its own option syntax.

11. Why can cd "~/Museum Media" fail in Bash even when the folder exists in the home directory?

The quoted leading tilde is not expanded in the normal way. Use the appropriate absolute or relative path or a correctly quoted home-variable form for that interpreter.

12. How does Windows Command Prompt change to both drive D and its downloads directory here?

cd /d "D:\Museum Media\downloads". The /d switch changes the drive as well as the directory under the documented Command Prompt behavior.

13. Why should ls -a not be assumed to work identically in PowerShell?

PowerShell may resolve ls to Get-ChildItem, whose parameters differ from a Unix ls program. Use the active command's help and appropriate parameters such as -Force when that is the intended behavior.

14. Which help fits a Bash built-in, Command Prompt dir, and an interactive SFTP client?

For example help cd in Bash, help dir or dir /? in Command Prompt, and help at sftp>. Installed man pages provide other applicable documentation where available.

15. After SSH login, the prompt changes to mediaops@display-hub. Where does a subsequent pwd run in this example?

In the permitted remote shell on display-hub, where it reports /home/mediaops. Confirm the host/account and actual path rather than relying only on a familiar prompt format.

16. Does changing directories in the SSH remote shell move the original local shell?

No. The remote session has its own context. exit returns to the prior local shell, which retains its own working directory.

17. What different questions do a host-key check and account authentication answer?

The host-key check concerns the server identity. User authentication concerns the account connecting to it. A familiar hostname or successful credential alone is not a substitute for both.

18. Nothing is echoed at an ordinary password prompt. Must the terminal be frozen?

No. Many password prompts deliberately show no typed characters. Use the approved authentication method without placing a real password in a shared transcript or command line.

19. Does an SFTP account necessarily need an unrestricted remote shell?

No. It can be limited to the supported file-transfer operations and a restricted path view. The fictional lab separately permits the demonstrated SSH inspection.

20. At sftp>, how do pwd and lpwd differ?

pwd shows the remote working directory; lpwd shows the client's local working directory. They can be unrelated paths.

21. Which SFTP command selects the local downloads directory, and which selects the remote reports directory?

lcd "/home/riley/Museum Media/downloads" selects the local side. cd /srv/display/reports selects the remote side in the stated lab.

22. With those directories selected, what does get playback-17.log do?

It reads /srv/display/reports/playback-17.log remotely and writes playback-17.log into the selected local downloads directory, unless an explicit different local destination is supplied.

23. With local uploads and remote incoming selected, what does put captions-v3.txt do?

It uploads the local captions-v3.txt from /home/riley/Museum Media/uploads into /srv/display/incoming in this lab, unless an explicit different remote target is given.

24. After SFTP lcd changes its local directory and bye exits, where is the parent shell in this transcript?

Still /home/riley. The SFTP client's local working-directory change does not change the parent shell's working directory.

25. For an approved service on port 2222, which client uses -p and which uses -P?

The shown ssh client uses ssh -p 2222, while sftp uses sftp -P 2222. Confirm the actual service and client syntax; the ordinary lab uses the default port.

26. An AI uses cd to select a path that exists only on the local client. What is the precise context correction?

Use lcd for the local source directory, confirm the intended remote destination with cd/pwd, and retain the appropriate get or put direction. Do not treat a wrong-side path as evidence that broad permission changes are needed.

27. Why inspect the destination before get or put and verify content afterward?

The operation can target or replace the wrong file if names or directories are mistaken. Check the intended source, existing target, correct destination, and the workflow's required content/checksum or acknowledgment.

28. Does a completed caption upload prove that the media display is using the new text?

No. This task stages the file in incoming. Application validation, review, and activation are separate steps whose success requires separate evidence.

Worked example

Interpret example command output without running disruptive commands.

Evidence

Address: 10.3.5.22/24
Gateway: 10.3.5.1
DNS query: timeout
HTTPS test by address: succeeds

The address and gateway are plausible for this subnet; successful service access by address narrows the problem. A resolver timeout supports a DNS investigation but does not distinguish server failure from filtering or misconfiguration. Compare resolver reachability and known-good settings.

Exercises

Exercise 1

What information would you collect before changing DNS settings after a timeout?

Show solution

Record the configured resolver, the exact name queried, timestamps and error output, whether other clients are affected, and whether an approved alternate resolver answers. A timeout alone does not identify a unique cause.

Exercise 2

Why should a technician preserve the original diagnostic output along with the interpretation?

Show solution

Another technician can review the evidence, compare later results, and detect mistaken assumptions. The interpretation may change, but the original readings establish what was actually observed.

Need help with this topic?

Work through questions with a tutor and get help with the steps you find difficult.

Get help with this topic