🖥️rm
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the rm command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ███╗ ███╗
# ██╔══██╗████╗ ████║
# ██████╔╝██╔████╔██║
# ██╔══██╗██║╚██╔╝██║
# ██║ ██║██║ ╚═╝ ██║
# ╚═╝ ╚═╝╚═╝ ╚═╝
# Remove files and subdirs
rm -rf path/to/the/target/
# Ignore non existent files
rm -f path/to/the/target
# Remove a file with his inode
find /tmp/ -inum 6666 -exec rm -i '{}' \;
#==============================#
# CMD RM - remove
#==============================##==============================#
rm -frv somestuff 2>&1 | tee remove.log
# When you want to see the output (including stderr) of your removal AND save it.
rm ./-file-starting-with-dash
# another way to handle files starting with a - in CWD is to prefix them with ./
rm "$( ls -1dt /netdumps/*.pcap | tail -1 )"
# Remove the oldest .pcap file in the /netdumps directory.
rm -rf "${MEETINGS[@]}"
# Remove meetings, really fast. (But make sure they are properly quoted)
rm -i
# Delete files, asking for confirmation
rm -frv somestuff 2>&1 | tee remove.log
# When you want to see the output (including stderr) of your removal AND save it.
rm ./-file-starting-with-dash
# another way to handle files starting with a - in CWD is to prefix them with ./
rm ./-
# Or rm -- - when you need to remove a file named - after you attempted to see if a program could write to STDOUT (It couldn't)
# To remove a directory that contains other files or directories
rm -r mydir
# do not receive a prompt for each file being removed
rm -rf mydir
#==============================##==============================#
# CMD RM #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command rm in a clear format. This allows users to quickly access the needed information for rm without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for rm are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.