About these notes: A maintenance-log entry from my own workflow: a Windows PC running Git Bash, connecting over SSH to an Ubuntu VPS. Hostnames shown below are examples from my own terminal, not credentials or universal values.
A command that worked a minute ago suddenly returns command not found. The server is usually fine — the terminal is no longer on the server. I hit this repeatedly while maintaining a WordPress site: one moment I was checking the panel, PHP and Redis, then SSH dropped, and the same commands stopped working. They were being typed into Windows Git Bash, not the remote machine.

Read the prompt before retyping anything
| Terminal shows | Where I actually was |
|---|---|
| root@vps3574328:~# | Logged in to the Ubuntu VPS |
| Administrator@DESKTOP-O1PA1DU MINGW64 ~ | Local Windows Git Bash |
| Connection to … closed | The SSH session had ended |
A window staying open is not evidence that a session is alive. Watch for the disconnect line and check the prompt.
bt: command not found
bt is the command-line entry point for the BT panel on the server. It is not a Windows command. When it “disappeared”, nothing had been uninstalled — I was simply asking the local shell for it. The same applies to redis-cli and to paths like /www/server/php, which exist in my server’s layout and not on a Windows desktop. That path is specific to my environment, not a standard PHP install location.
| What to confirm | Method and how to read it |
|---|---|
| Am I on the right machine? | Read the prompt, run hostname; machine names are customisable, so do not rely on seeing “root” alone |
| Which OS is this? | uname -s; remote is Linux here, local Git Bash is a different environment. This alone cannot distinguish two Linux servers |
| Is the command spelled correctly? | Check spelling, spaces and flags against the tutorial before installing anything |
| Do these files belong to this machine? | Cross-check the install record and the panel; /www/server/php is a path from this environment only |

What I do after a disconnect
Reconnect, confirm the prompt and hostname, then re-run only the commands whose output I still need. An SSH disconnect does not stop the website: the web server, PHP-FPM and database keep running independently of my session. Long-running foreground jobs are a separate question — if a task was attached to the terminal when the connection closed, check its state after reconnecting rather than assuming it finished.
Frequently asked questions
redis-cli: command not found — is Redis missing?
Not necessarily. First confirm you are on the server. If you are, then check whether the package is installed and whether the binary is on PATH.
Do I have to re-run every command from before the drop?
No. Re-run the ones whose results you need. Commands that had already completed on the server completed there, regardless of what happened to your terminal.
Still not found after reconnecting — then what?
Now it is a real server-side question: verify the package, the service name, the PATH and the install path. That is a different problem from a dropped session.
A six-line checklist before retyping the command
When a command suddenly disappears, the fastest route is not reinstalling anything: it is establishing which machine is answering you. The table below is a generic troubleshooting order, not a new measurement or a new finding from my own session. Paths and service names on your server will differ from mine.
| Symptom | First check | What it usually means |
|---|---|---|
bt: command not found right after a disconnect |
whoami and hostname |
You may be back in the local Windows shell, not on the server. |
redis-cli: command not found while logged in |
command -v redis-cli |
The package may not be installed, or the binary is outside PATH. |
| A command that worked a minute ago now fails | pwd |
The working directory changed; the session is no longer the same machine. |
| A service reports running but the binary is missing | type -a <command> |
Service state and command availability are two separate things. |
| Permission errors instead of “not found” | id |
A different user or a missing sudo, not a missing package. |
| Still failing after a clean reconnect | Compare prompt, host name and path side by side | Two terminals may be open; confirm which one you are typing into. |
How I tell the local shell from the remote one
Three read-only commands are usually enough: whoami tells you which account is active, hostname which machine, and pwd which directory. On the Windows Git Bash side I expect a home path that looks like a local user directory; on the VPS I expect a server host name and a Linux path. If the prompt itself has changed from a server-style prompt to a local one, the SSH session ended and the following commands never reached the VPS.
I only move on to installation questions after those three checks agree. That order is the whole point of the Redis investigation these commands belonged to: a running service does not prove that a client binary exists, and a failed client command does not prove that the service is down. The same discipline shows up in the PHP upgrade 502 log, where the active process and its config path mattered more than the config I had just edited. For the basics of what a VPS is and which parts you control, see What Is a VPS?.
If you are setting up the whole stack from scratch, the eight-stage setup guide puts SSH, the panel and PHP in order; the pre-purchase checklist covers what to confirm with the provider, and the first-year cost notes explain why maintenance time is part of the price. The machine these notes came from is documented in the InterServer review, with a separate timing sample kept clearly apart from this terminal problem.
Where to read next
Redis Installed but WordPress Not Using It: Service, PING and Object Cache covers the Redis service investigation that these commands belonged to, WordPress 502 After a PHP Upgrade: Tracing ‘Permission denied’ in the Nginx Log the PHP 8.3 upgrade that needed the same terminal discipline, and What Is a VPS? Domain, Hosting and WordPress Explained From My Own Setup the basics of what a VPS actually is.