Nếu bạn là system admin mà chạy lệnh này
rm -rf /
trên Linux server bạn quản lí thì sẽ hư hết máy chủ vật lí Linux hoặc máy ảo Linux.
Biết được sự nguy hiểm này nên từ 2018 người ta đã lập trình thêm để lệnh này không thể chạy được.
Dưới đây mình thực hiện xóa dữ liệu bằng lệnh rm trên Rocky Linux 9.
[root@rocky93 ~]# rm -rf /
rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe
Bạn phải thêm –no-preserve-root để chạy được rm -rf / nếu muốn chơi dại hoặc học cách khôi phục dữ liệu trên Linux khi gặp sự cố nghiêm trọng là xóa dữ liệu trên Linux bằng lệnh rm.
Dòng Enterprise Linux 5 6 7 8 9 đã cẩn thận tạo alias cho lệnh rm và mv là luôn hỏi trước khi xóa, đổi tên, di chuyển file hoặc thư mục.

rm -i hoặc mv -i là luôn hỏi trước khi chạy, nói cho văn vẻ thì i là interactive là tương tác với người dùng trước khi thực hiện.
[root@alma93 ~]# alias
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'
Khi xài -f là force là bắt buộc, bạn đã bất chấp tất cả vì nó sẽ bỏ qua tùy chọn -i là interactive, tức là không cần hỏi han gì nữa, xóa liền luôn đi.
# rm -r /
rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe
# rm -r / --no-preserve-root
rm: descend into directory '/'? n
# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.3 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.3 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.3"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.3"
Tóm lại lệnh rm -rf / không nguy hiểm như bạn nghĩ.