Sunday 27, Apr 2025
We are moved to new domain
Click -> www.ehowtonow.com
Monday, 17 July 2017

Delete file - rm Linux command

rm

rm [options] files

Description

Delete one or more files. To remove a file, you must have write permission in the directory that contains the file, but you need not have permission on the file itself. If you do not have write permission on the file, you will be prompted (y or n) to override. rm is often aliased to rm -i, especially for the root user, to protect against inadvertently deleting files.

Options

-d, --directory
Remove directories, even if they are not empty. Available only to a privileged user.

-f, --force
Remove write-protected files without prompting.

--help
Print a help message and then exit.

-i, --interactive
Prompt for y (remove the file) or n (do not remove the file).

--no-preserve-root
Do not treat root (/) specially. This is the default.

--preserve-root
Do not operate recursively on root (/).

-r, -R, --recursive
If file is a directory, remove the entire directory and all its contents, including subdirectories. Be forewarned: use of this option can be dangerous.

-v, --verbose
Verbose mode (print the name of each file before removing it).

--version
Print version information and then exit.

--
Mark the end of options. Use this when you need to supply a filename beginning with -.

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer

Related Posts:

  • Report on active processes ps Linux Command ps ps [options] Description Report on active processes. ps has three types of options. GNU long options start with two hyphens, which are required. BSD options may be grouped and do not start with a hyphen, while Unix98 o… Read More
  • Execute command as the superuser - sudo Linux Command sudo sudo [options] [command] Description If you are allowed, execute command as the superuser. Authorized users of sudo and the commands they are permitted to execute are listed in the sudo configuration file, /etc/sudoe… Read More
  • host Linux Command host host [options] name [server] Description System administration command. Print information about hosts or zones in DNS. Hosts may be IP addresses or hostnames; host converts IP addresses to hostnames by default and ap… Read More
  • tar Linux Command tar tar [options] [tarfile] [other-files] Description Copy files to or restore files from an archive medium. If any files are directories, tar acts on the entire subtree. Options need not be preceded by - (though they may… Read More
  • Switch User su Linux Command su su [option] [user] [shell_args] Description Create a shell with the effective user ID user. If no user is specified, create a shell for a privileged user (i.e., become a superuser). Enter EOF to terminate. You can run … Read More
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: Delete file - rm Linux command Rating: 5 Reviewed By: eHowToNow