文件操作CLI Manual
$rm
Remove files or directories from the filesystem.
命令语法POSIX Standard
rm [OPTIONS] FILE...在交互式终端沙盒中实时运行
无需安装的客户端实时仿真环境。
bash — terminal
AST Sandbox (Free)
概述与工作原理
`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 / Option | Description |
|---|---|
| -r, -R | Remove directories and their contents recursively. |
| -f | Force removal without prompting for confirmation or reporting non-existent files. |
| -i | Prompt interactively before every file removal. |
| -v | Verbose mode explaining what is being deleted. |
实际生产案例与代码范例
相关 Linux 常用命令
$find文件操作
根据文件名、类型、大小或修改时间在目录层级中高效搜索文件与目录。
$cat文件操作
连接文件并在终端标准输出上打印文件内容。
$mkdir文件操作
Create new directories and folder hierarchies.
$cp文件操作
Copy files and directories to a destination path.
$mv文件操作
Move or rename files and directories.
$touch文件操作
Create empty files or update file access and modification timestamps.