DEV Community

Cover image for Living in the Shell #13; rm (Delete Files/Directories)
Babak K. Shandiz
Babak K. Shandiz

Posted on β€’ Originally published at babakks.github.io on

2 2

Living in the Shell #13; rm (Delete Files/Directories)

rm πŸ’£

Removes files or directories.

πŸ’€ Removal is irreversible.

Remove a single file

rm some-file
Enter fullscreen mode Exit fullscreen mode

Remove multiple files

rm first-file second-file third-file
Enter fullscreen mode Exit fullscreen mode

Remove a directory -r

rm -r my-dir
Enter fullscreen mode Exit fullscreen mode

Set to prompt before every removal -i

rm -ri my-dir
Enter fullscreen mode Exit fullscreen mode

Set to suppress any interaction/error -f

rm -rf my-dir my-non-existing-dir
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay