Written 1 Sep 2026. This is a how-to, not a product card. Buy links are not tagged yet.
Empty or shrink a leftover-box practice file
After leftover-box od (or after writing a practice file), use truncate so you empty or shrink the file without deleting its name. You do not need extra system software beyond coreutils.
Finish leftover-box disk writes flushed pending writes. Peek at leftover-box file bytes showed what landed. Tonight is a careful size change: keep the same home path, but empty or shrink the file. truncate sets length. It does not remove the name. Removing the name is delete a leftover-box file carefully. That is not a wipe with shred. That is not copying disks with dd. You are still only practicing in home. The leftover box does not need htop, Grafana, or a NAS for this one job.
Skip until SSH already works
SSH from the couch should already get you a leftover-box prompt. If you only need to write practice words, that is print leftover-box words leftover-box exactly or put a short line into a leftover-box file. If you only need to flush writes, that is finish leftover-box disk writes. If you only need a peek at bytes, that is peek at leftover-box file bytes. If you only need the throwaway gone, that is delete a leftover-box file carefully. 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
truncate sets a file’s length in bytes. -s 0 empties the file and leaves the name. -s N sets the exact size to N bytes (shrink keeps the start of the file; grow can pad with empty space, sometimes called a hole). It does not delete the path. It is not rm -i. Rm removes the name. Truncate changes size.
Practice truncate in home
SSH in. Make sure home is where you are sitting:
pwd
You want a path that ends in your login name. If not:
cd ~
Park one short practice line (see printf or echo):
printf 'hello\n' > ~/trunc-a.txt
Optional flush (see sync):
sync
Note the size before you change it:
ls -l ~/trunc-a.txt
You want a small non-zero size (hello plus a newline is typically 6 bytes).
Optional peek (see od):
od -c ~/trunc-a.txt
Empty the file, keep the name (night one job):
truncate -s 0 ~/trunc-a.txt
Check again:
ls -l ~/trunc-a.txt
You want size 0. The name ~/trunc-a.txt is still there. That is the whole point of tonight.
Optional shrink after rewrite: put the line back, then keep only the first three bytes:
printf 'hello\n' > ~/trunc-a.txt
truncate -s 3 ~/trunc-a.txt
od -c ~/trunc-a.txt
You want something like the letters h e l and then the prompt back — the rest is gone, the name remains.
Optional grow (lightly — do not make sparse files the lesson):
truncate -s 10 ~/trunc-a.txt
ls -l ~/trunc-a.txt
Size can show 10 even if the middle is empty space on disk. Night one only needs: empty with -s 0, or shrink with a small N. Skip sparse deep-dives.
Debian and Ubuntu usually already have truncate (coreutils). Do not make apt the lesson. If it is somehow missing:
sudo apt install coreutils
Then stop. That install is not a reason to buy disk tools.
When you are done practicing:
rm -i ~/trunc-a.txt
Ask first. Say yes only if the name matches. That careful delete is delete a leftover-box file carefully. Skip rm -rf.
Useful extras, still home-safe
Skip truncate on /etc, whole disks, USB device nodes, or anything outside home. Night one is one tiny home practice file.
Skip truncate as a wipe. Emptying a practice file is not shred and not dd. Those are different (and scarier) jobs.
Skip huge files as tonight’s job. Night one is a tiny home file, not logs, images, or disk images.
Skip piping truncate into rm. Truncate changes size. Rm deletes. Do not mix those jobs.
Skip awk, sed, and install as new pages this cycle. Free space is already see if the leftover box still has room (that is the df look — do not invent a separate df how-to).
Skip hexdump and xxd as tonight’s job. Peeking stays on od.
Skip screen, tmux, port 22 forwarding, apt as the lesson, htop, Grafana, and a NAS. Keep SSH on the house network: keep the leftover box on the house network. Do not forward port 22.
Skip leftover-box-awk, leftover-box-sed, and leftover-box-install this cycle.
What this is not
This is not leftover-box sync. That is finish leftover-box disk writes. It is not leftover-box od. That peeks at bytes: peek at leftover-box file bytes. It is not leftover-box strings. That shows printable leftover-box text without a full dump: see printable leftover-box text with strings. It is not leftover-box printf or leftover-box echo. Those write words: print leftover-box words leftover-box exactly, put a short line into a leftover-box file. It is not leftover-box rm. That removes the name: delete a leftover-box file carefully. It is not leftover-box cat. That prints text as text: read a leftover-box file without opening the editor. It is not leftover-box cmp. That compares two files: see whether two leftover-box files match byte for byte. It is not leftover-box sha256sum. That fingerprints one file: check a leftover-box file fingerprint. It is not free disk space. That is see if the leftover box still has room. It is not opening SSH to the internet so you can shrink files from a coffee shop. That is keep the leftover box on the house network. Do not forward port 22.
What next
Need a peek first? Peek at leftover-box file bytes. Need printable leftover-box text without a full dump? See printable leftover-box text with strings. Need a flush first? Finish leftover-box disk writes. Need exact practice words? Print leftover-box words leftover-box exactly. Need a short line with the newline echo always adds? Put a short line into a leftover-box file. Need the throwaway gone (name and all)? Delete a leftover-box file carefully. Need free space? See if the leftover box still has room. Need a fingerprint? Check a leftover-box file fingerprint. Need two files compared? See whether two leftover-box files match byte for byte. When key login is boring on every computer you use, turn off leftover-box password login once the key works. Keep SSH on the house network: keep the leftover box on the house network. Do not forward port 22. Leftover-box-install and leftover-box-awk stay deferred this cycle.
Skip
- Skip if SSH still fails. Finish SSH from the couch first.
- Skip
sync,od,printf, orechoas tonight’s job if you only came to change size. Those notes already exist. - Skip
truncateon/etc, disks, USB devices, or anything outside home. - Skip
truncateas a wipe (not shred/dd), huge files as the job, and pipingtruncateintorm. - Skip
awk/sed/install as new pages this cycle,hexdump/xxdas the job,screen,tmux, apt as the lesson, htop, Grafana, and a NAS. - Skip leftover-box-awk, leftover-box-sed, and leftover-box-install this cycle.
- Skip
rm -rf. Careful delete only: delete a leftover-box file carefully. - Skip opening SSH to the internet. That is keep the leftover box on the house network. Do not forward port 22.
Sources
Debian: truncate(1). Ubuntu: truncate(1). GNU coreutils: truncate. Official pages only. For the peek, see peek at leftover-box file bytes. For the flush, see finish leftover-box disk writes. For exact words, see print leftover-box words leftover-box exactly. For a careful delete, see delete a leftover-box file carefully. For the login, see SSH from the couch.