Linux Basic Command Learning RM (6)

Source: Internet
Author: User

Rm

1. Command Format

usage : RM [Options] File ...

CD [directory name ]

2. Command function

Delete one or more files or directories in a directory , RM does not delete if the-r option is not used except the directory. If you use RM to delete a file, you can usually still restore the file to its original state.

3 command parameters and instances

- F,--force ignores nonexistent files and never gives hints.

-I ,--interactive for interactive deletion

 -r, -r , --recursive  instructs RM to recursively delete all directories and subdirectories listed in the parameter  

--help Display This help message and exit

--version Output version information and exit

#####################################################################

Example One: Delete file , the system will first ask whether to delete.  

Command:

RM file name

RM a.txt

[[email protected] /]# cd /data[[email protected] data]# lsadmin.log   b.txt  dcp   jim         lucy      super    team   test2      youa.txt      c.txt  dong  link_a.txt   Pbc.bmp  teacher  test1  test.txt[[email protected] data]# rm  a.txtrm: remove regular file  ' a.txt '?  y[[email protected] data]#  find /data -name  "A.txt"  [[email protected] data]# lsadmin.log   c.txt  dong  link_a.txt  pbc.bmp  teacher  test1   test.txtb.txt      dcp    jim   lucy         super    team     test2  you[[email  protected] data]#


Example 2 : will be Data subdirectories and subdirectories in all file Delete , and do not ask

Command:

Rm-r F/data

[[email protected] data]# Rm-rf/data[[email protected]/]# LSA boot home lost+found opt sbin sys test      3 Varbackup Dev Lib media proc selinux test tmp vmwarebin etc lib64 mnt root srv Test1 Usr[[email protected]/]#



This article is from the "Qin Xian son" blog, please make sure to keep this source http://youdong.blog.51cto.com/3562886/1718146

Linux Basic Command Learning RM (6)

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.