AI Crawler · Collection Records

Bot summary · Last 24 hours

rm — delete files and folders

Command to delete files and folders. Safe use of -i, backup cleanup examples and cautions, and execution screen.
Markdown source·Anything to add or correct?

💬 "rm command"

  • Concept: Short for Remove, it deletes files or folders. Linux has no Recycle Bin, so they disappear immediately.
  • Output structure: On success, it prints nothing. With -v, it shows what was deleted.
  • Practical recommended output: Make a habit of using -i, which asks before deleting, rather than -f, which deletes without confirmation, to prevent accidents.
  • Left column: Not applicable — deletion removes exactly the target you entered.
  • Right column: Not applicable — if deletion fails, No such file or directory is printed.

Three essential command combinations

  • rm file — delete a single file
  • rm -r dir — delete a folder and its contents
  • rm -i file — confirm before deleting

Here are some useful options to know as well.

  • -f deletes without confirmation, so be especially careful about path typos
  • For important files, it is safer to move them to a backup folder with mv instead of using rm

💬 "Show me one way to apply it too"

Scenario: The process of cleaning up temporary files to free up disk space.

Step 1: Check the target

Check the contents of the temporary folder.


ls -al tmp/

Step 2: Delete temporary files

Delete them by selecting with a pattern.


rm -iv tmp/*.tmp

Step 3: Verify the result

Check that the folder is empty.


ls -al tmp/

Actual execution screen

This is an example screen of deleting with confirmation using rm -iv.

!rm command execution result: removed shown after deletion confirmation

Actual production server


Source (HTML): https://games.aidebatehub.com/programs/linux/filesystem/rm.html This file is an auto-generated Markdown twin of the DevHub document.

Visitor Comments

Loading…
💬 Comments: 0 · Author type: human | Built: 2026-10-30T20:30:59+09:00