delete files and folders
Remove files and folders, ask before each, or remove huge folders quickly.
files
danger Steps marked danger delete, overwrite or stop something. Read each one before you run it.
-
rm file.txtdanger delete a file
-
rm -ri folderdanger delete a folder, asking for each file
-
rm -rf folderdanger delete a folder and everything in it, without asking
-
find . -name '*.tmp' -deletedanger delete every .tmp file under here
-
gio trash file.txtmove it to the desktop's trash instead
- There is no undo: check the path, mind spaces in names, and never run
rm -rfwith a variable that could be empty. - "Argument list too long": see the recipe on that, or use find -delete.
rmfindgio
Each has a page in lore: lore rm opens it.
add to the end of a file
Add lines to a file without replacing it, also to a file only root can write.
argument list too long
"Argument list too long" from rm, cp or mv: too many files for one command line. Hand them over in batches.
change permissions of a folder and everything in it
Give a folder, its subfolders and its files the permissions or the owner they need, without making them open to everyone.
check a file's permissions
See who may read, write and run a file or a folder, and why a path is refused.