Written 29 Aug 2026. This is a how-to, not a product card.
See what kind of file this is
After SSH works, ask what kind of file this is with file before you dump it. You don't need a file viewer for this.
See what's in a folder shows names. Read a file without opening the editor dumps text. Before you print a mystery name, file tells you whether it is text, a picture, a zip, or a program. You are still only looking. It does not need a desktop, a file manager, or a NAS for this one job.
Skip until SSH already works
SSH from the couch should already get you a prompt. If you already know the file is short text, that is read a file without opening the editor. If you want how many lines a text file has, that is see how long a file is. If you want the name of a file somewhere on the computer, that is find a file by name. Skip this whole note if you only need a house share other computers browse. That is a folder the house can open.
What this is
file peeks at a path and says what kind of thing it looks like. You run it on the computer, after SSH. The file stays on disk. You are only looking. It does not dump the words. That is cat. It does not list the folder. That is ls. It does not count lines. That is wc. It does not open an editor. That is nano. One path, same computer, a kind.
Ask what kind it is
SSH in. Make a throwaway text file, then ask:
printf 'apple\\nbanana\\ncherry\\n' > ~/fruit.txt
file ~/fruit.txt
You should see something like ASCII text, or Unicode text. That means a dump with cat is safe. That is the whole first-night trick.
A real path that is safe to practice on:
file /etc/hosts
That file is already on Debian and Ubuntu. You are only looking. Don't edit it.
Compare with a program the computer already has:
file /bin/ls
That answer should mention executable or ELF. Don't cat that. A dump of a program floods the window with garbage.
Useful extras, still looking only
Ask about a few paths at once:
file ~/fruit.txt /etc/hosts /bin/ls
Need a short text dump after file says text? That is read a file without opening the editor. Need a line count first? That is see how long a file is.
If you see command not found, install the usual tool, then try again:
sudo apt install file
Debian and Ubuntu Server usually already have it. That install is not a reason to buy a file viewer.
When you are done practicing:
rm -i ~/fruit.txt
What this is not
This is not a dump of the file. That is read a file without opening the editor. It is not paging through every line. That is read a file one screen at a time. It is not a peek at the last lines. That is see the end of a file. It is not a peek at the first lines. That is see the start of a file. It is not a line count. That is see how long a file is. It is not a list of names in a folder. That is see what's in a folder. It is not a search by name across the computer. That is find a file by name. It is not an editor. That is edit a file from the couch. It is not a house share other computers browse. That is a folder the house can open.
What next
Need only the opening lines of a long file? See the start of a file. Need a short text file printed all at once? Read a file without opening the editor. Need the whole long file one screen at a time? Read a file one screen at a time. Need only the newest lines at the bottom? See the end of a file. Need a line count before a dump? See how long a file is. Need only the lines with one word? Find a word in a file. Forgot which folder holds the file? Find a file by name. Need to change a line? Edit a file from the couch. Need a spare before you edit? Copy a file without leaving the computer. Need the throwaway gone for real? Delete a file carefully. Need a file from the laptop instead? Copy a file to the computer from your laptop. When a house job broke, look at the computer's own diary: when something broke, look at the log. When key login is boring on every computer you use, turn off password login once the key works. Keep SSH on the house network: keep the computer on the house network. Don't forward port 22.
Skip
- Skip if SSH still fails. Finish SSH from the couch first.
- Skip
caton a mystery name untilfilesays text. A program or a zip dumps garbage. - Skip
fileif you already know the path is a short text note you made tonight. That is read a file without opening the editor. - Skip buying a file manager, a “cloud IDE,” or a NAS to ask what kind one path is.
- Skip SSH settings,
/etc/shadow, and anything under/etc/ssh. Looking at trusted laptop keys is see which laptop keys the computer already trusts. - Skip opening SSH to the internet so you can inspect files from a coffee shop. That is keep the computer on the house network.
Sources
Debian: file. Ubuntu: file. file(1) home. Official pages only. For the login, see SSH from the couch. For a short dump, see read a file without opening the editor. For a line count, see see how long a file is. For names in a folder, see see what's in a folder.