create an empty file
Make a new empty file, empty an existing one, or make a file with a few lines in it.
files
danger Steps marked danger delete, overwrite or stop something. Read each one before you run it.
-
touch file.txtmake it if it is not there; else just update its date
-
> file.txtmake it, or empty it if it is there
-
truncate -s 0 file.txtdanger empty a file, even one a program has open
-
echo 'one line' > file.txtmake it with one line in it
-
printf 'line 1\nline 2\n' > file.txtwith several lines
touchtruncateprintf
Each has a page in lore: lore touch 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.