Linux rm command details how to use Linux rm command

Source: Internet
Author: User

The Linux rm command is used to delete a file or directory.

Syntax

Rm [options] name...

Parameters:

  • -I ask for confirmation one by one before deletion.

  • -F the original file is deleted directly even if its attribute is set to "read-only". You do not need to confirm the attribute one by one.

  • -R also deletes directories and the following files one by one.

Instance

You can use the rm command to delete a file. If you delete a directory, you must use the "-r" option. For example:

# Rm test.txt rm: Do you want to delete the general file "test.txt "? Y # rm homework rm: the "homework" directory cannot be deleted: it is a directory # rm-r homework rm: Do you want to delete the "homework" directory "? Y

Delete all files and directories in the current directory. Command behavior:

Rm-r *

Once the file is deleted using the rm command, it cannot be recovered. Therefore, you must use this command with caution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.