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

babakks

Babak K. Shandiz

Posted on December 12, 2021

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
šŸ’– šŸ’Ŗ šŸ™… šŸš©
babakks
Babak K. Shandiz

Posted on December 12, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related