• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Linux-Ubuntu | rm -- remove files/directories
  1. Notes
  2. Examples
  3. Command Help (man rm)

  1. Notes

    The rm command is not reversible. The shell doesn't provide a Trash from where the deleted files and directories can be restored.
    The option -i can be used to request confirmation before deleting a file or a directory.
  2. Examples
    • Remove a file (see bellow the option -i to request confirmation before deleting the file):

    • Remove all files (excluding subdirectories and files starting with a period (.)) in the folder:
      It may complain that there are subdirectories in folder1: "rm: folder1/folder11: is a directory".

    • Remove all files starting with a period (.) in a folder (excluding sub-directories).
      It may show this warning: "rm: "." and ".." may not be removed".

    • Remove the directory
  3. Command Help (man rm)
    The following options can be used:
© 2025  mtitek