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.
filesshell
danger Steps marked danger delete, overwrite or stop something. Read each one before you run it.
-
find . -maxdepth 1 -name '*.log' -deletedanger delete them without listing them on the command line
-
find . -maxdepth 1 -name '*.jpg' -exec mv -t /dest/ {} +move them, many at a time (GNU mv)
-
printf '%s\0' *.log | xargs -0 rmxargs makes batches that fit
-
getconf ARG_MAXhow long a command line can be here
findxargsgetconf
Each has a page in lore: lore find 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.
get a file's name, folder and extension
Take a path apart in a script: the folder, the name, the name without its extension, the extension.
rename many files
Change the ending of many files, replace spaces in names, or number them.
add a folder to the path
Let the shell find programs in a folder, for good, and reload the settings without logging out.