← Terminal to Agents
Terminal to Agents

Files Without a Mouse — Make, Write, Move, and Delete

10 Sept 2026·5 min read

Last time you learned to move around and look. Today you start changing things. I am going to give you the dangerous one first, because you will meet it anyway and it is better met on purpose.

rm deletes. Permanently.

rm notes.txt
Deletes the file. It does not go to the recycle bin.
Read this once, properlyThere is no recycle bin, no undo, and no "are you sure?". The file is unlinked from the disk and that is the end of it. This is not a design flaw — the terminal assumes you meant what you typed. Which is exactly why you read the line before pressing Enter, every single time.

The dangerous version is the one with a star in it, because a star means "everything matching this". rm *.txt deletes every text file in the folder. That is genuinely useful and genuinely unforgiving, so look at what the star will match before you run it — ls *.txt shows you exactly that, safely.

Now the gentle three

mkdir notes
Make directory — creates a folder called notes.
touch todo.txt
Creates an empty file. If it already exists, nothing is lost — only its timestamp changes.
cp todo.txt todo-backup.txt
Copy — the original stays exactly where it was.

Now write something in it

An empty file is not much use, and you cannot double-click it from in here. You need an editor that lives inside the terminal. People usually get sent to vim at this point and bounce off it — start with nano instead.

nano todo.txt
Opens the file, or creates it. Type normally — the arrow keys work.
The whole editor in two keysCtrl+O then Enter saves — O for output. Ctrl+X leaves. And you do not have to remember either, because nano prints its shortcuts along the bottom of the screen the whole time. The ^ in that bar means Ctrl, so ^O is Ctrl+O. That bottom bar is the manual.

The one that does two jobs

mv todo.txt notes/
Moves the file into the notes folder.

And with a name instead of a folder, the same command renames — because moving a file to a new name in the same place is exactly what renaming is:

mv todo.txt done.txt
Same command, no folder — so this is a rename.
One habit that prevents most accidentsBefore any command that removes or overwrites, run ls first and read what is actually there. Two seconds of looking has saved more work than any clever recovery tool.
Do this in 60 secondsmkdir practice, then cd practice, then touch a.txt, then cp a.txt b.txt, then ls. Four files-and-folders commands and a look. Then rm b.txt — and notice there is no confirmation.
Today’s AI angleThis is the exact reason a coding agent asks before it deletes or overwrites anything. It is running the same rm you just ran, with the same absence of an undo — which is why you keep approval switched on for the commands that destroy things.

That is nine commands in four days, and I have been handing them to you one at a time. Next time I stop doing that — because almost every command on your machine can explain itself to you, and once you know how to ask, you do not need me for the rest of them.

Files Without a Mouse — Make, Write, Move, and Delete · Ali Huzaifa