You can delete one file, a directory, or many files at once picked by a filename pattern.
rm deletes a file at once. The command line has no trash to restore it from. rmdir deletes an empty directory and refuses if anything is inside, which is a safeguard. rm -r deletes a directory with its contents: run it only when you know exactly what is in there.
When there are many files, a filename pattern picks them. The asterisk stands for any part of a name: *.tmp means "every name ending in .tmp". The shell replaces the pattern with the matching names in the current directory — the lesson "Help and the shell" covers how.
A pattern in rm deletes everything it matches. List the files with ls and the same pattern first, then delete.
Rename and clear out temporary files
In ~/file-lab/handoff, rename notes.txt to README.txt and delete every temporary *.tmp file. Leave the source directory alone: it holds the originals.
Goals · 0 of 2
- Rename notes.txt to README.txt not done yet
- Delete the temporary files from handoff only not done yet