Difference between revisions of "Rm (command)"

From wikieduonline
Jump to navigation Jump to search
Line 11: Line 11:
 
  rm -rf
 
  rm -rf
  
  echo "" > /path/to/the/file.log
+
  [[echo]] "" > /path/to/the/file.log
  
 
  If it was already deleted, on Linux, you can still truncate it by doing:
 
  If it was already deleted, on Linux, you can still truncate it by doing:
Line 17: Line 17:
  
 
  rm: cannot remove 'XXXX': [[Read-only file system]]
 
  rm: cannot remove 'XXXX': [[Read-only file system]]
 
  
 
== Related terms ==
 
== Related terms ==

Revision as of 05:52, 26 July 2022

wikipedia:rm (Unix) included in coreutils package is used to remove different type objects such as computer files, directories and symbolic links from file systems and also special files such as device nodes, pipes and sockets.

The rm command removes references to objects from the filesystem using the unlink system call.

Man page: https://man7.org/linux/man-pages/man1/rm.1.html

Examples

rm /path/to/your/file
rm -rf
echo "" > /path/to/the/file.log
If it was already deleted, on Linux, you can still truncate it by doing:
echo "" > "/proc/$pid/fd/$fd"
rm: cannot remove 'XXXX': Read-only file system

Related terms

Activities

See also

Advertising: