728x90 AdSpace

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 -.
Annamalai Thangaraj

Annamalai is working as Technical Lead in Leading Telecom company with 5+ years experience in Identity and Access Management , Telecom and Networks, BigData, Java, Spring, Struts, Hibernate, AngularJS, and Enterprise Web Application Development.

Website: Java Tutorials Corner

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

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