↑ ↓ select, Enter open, Esc close

Delete a file

Adjust the values, the command updates live
user@server
rm -i -- /var/www/vhosts/example.com/httpdocs/old.zip

Deletes the given file. -i asks before deleting, -- prevents a file name starting with a hyphen from being read as an option. Directories have their own entry using rm -r.

Note: The shell has no trash bin. Deleted files only come back from a backup.

Also searched as

  • delete a file in linux
  • remove a file
  • delete a single file from the shell
  • linux rm file

Related one-liners

All in Filesystem

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.