Online Linux Terminal Logo
OnlineLinuxTerminal
Операции с файламиCLI Manual

$rm

Remove files or directories from the filesystem.

Синтаксис командыPOSIX Standard
rm [OPTIONS] FILE...
Сообщество Linux2.4k Онлайн

Общайтесь с пользователями Linux, учите команды и скачивайте шпаргалки.

Попробуйте в интерактивной песочнице

Клиентская симуляция без установки с мгновенным результатом.

Открыть в полноэкранном терминале ↗
bash — terminal

Обзор и принцип работы

`rm` (Remove) deletes files and directories. Linux filesystems do not have a "Recycle Bin" or "Trash" for CLI commands—once a file is removed with `rm`, its data blocks are unlinked immediately. Combining `-r` (recursive) and `-f` (force) allows removing non-empty directory trees.

Основные флаги и параметры команды

Flag / OptionDescription
-r, -RRemove directories and their contents recursively.
-fForce removal without prompting for confirmation or reporting non-existent files.
-iPrompt interactively before every file removal.
-vVerbose mode explaining what is being deleted.

Практические примеры использования

#1Remove a specific file
rm /home/user/notes.txt && ls -l

Deletes notes.txt and verifies the directory listing.

#2Recursively delete a directory and all files
rm -rf /tmp/test_dir

Forces recursive removal of the test directory without confirmation prompts.