Written 30 Aug 2026. This is a how-to, not a product card.
Put lines in order
After SSH works, put lines in order with sort so a mixed list is easier to scan. You don't need a file manager for this.
A mixed list is harder to scan. Tonight you put lines in order: sort. Sort puts lines in A-to-Z order. Start with a tiny fruit list. You are still only looking. The computer does not need a file manager for this one job.
Skip until SSH already works
SSH from the couch should already get you a prompt. If copies dropped are what you want, that is drop duplicate lines. Uniq wants sorted input. If output saved while you watch is what you want, that is watch and save output at once. If last line first is what you want, that is reverse lines.
What this is
sort puts lines in order. You type sort, then a file. It prints the ordered lines. It does not rewrite the file unless you redirect. Default order is A-to-Z as text. Numbers as text put 10 before 2. -n sorts as numbers. -r reverses. It is not uniq. Uniq drops copies after sort.
Sort a practice list
SSH into the computer. Make a tiny mixed list:
printf 'pear\napple\nbanana\napple\n' > ~/fruit.txt
cat ~/fruit.txt
Put lines in order:
sort ~/fruit.txt
You want apple, apple, banana, pear. That is enough for tonight. Practice only in home.
Debian and Ubuntu usually already have sort. Don't make apt the job. If sort is missing:
sudo apt install coreutils
Then stop. That install is not the lesson.
When you are done, throw the practice files away. Careful delete only. That is delete a file carefully. Skip rm -rf.
rm ~/fruit.txt ~/fruit-sorted.txt ~/nums.txt
Useful extras, still looking only
Optional: save while you watch:
sort ~/fruit.txt | tee ~/fruit-sorted.txt
cat ~/fruit-sorted.txt
That tee is watch and save output at once.
Optional: reverse:
sort -r ~/fruit.txt
Optional: numbers as numbers, not text:
printf '10\n2\n1\n' > ~/nums.txt
sort ~/nums.txt
sort -n ~/nums.txt
Text sort puts 10 before 2. -n puts 1, then 2, then 10.
Optional: sort names in this folder:
ls | sort
Looking only. Skip sort piped into rm.
What this is not
This is not uniq. That is drop duplicate lines. It is not tee. That is watch and save output at once. It is not pipe as the lesson. That is send output into another command. It is not tac. That is reverse lines. It is not opening SSH to the internet. That is keep the computer on the house network.
What next
Need copies dropped? Drop duplicate lines. Need output saved while you watch? Watch and save output at once. Need last line first? Reverse lines. 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 uniq, tee, pipe, and tac as tonight's job. Those pages already exist.
- Skip sort piped into
rm. Sort prints. Don't mix delete into this drill. - Skip sorting
/etcor whole home. Tonight: a tiny practice list. - Skip files under
/etc, SSH folders, or paths you don't own. Practice only in home. - Skip
rm -rf. Careful delete only: delete a file carefully. - Skip opening SSH to the internet so you can do this from a coffee shop. That is keep the computer on the house network. Don't forward port 22.
Sources
GNU coreutils: sort invocation. Debian: sort. Ubuntu: sort. Official pages only. For the login, see SSH from the couch. For duplicates, see drop duplicate lines.