Daily Tip 2015-10-20

Source: Internet
Author: User

[Email protected]:~# cd/tmp # (usually I 'll use this directory)
[Email protected]:/tmp# ll
[Email protected]:/tmp#


[Email protected]:/tmp# mkdir lldir
[Email protected]:/tmp# Touch ll.txt old.txt new.txt

[Email protected]:/tmp# ll
Total Dosage 4
Drwxr-xr-x 2 root root 4096 October 21:50 Lldir
-rw-r--r--1 root root 0 October 21:47 ll.txt
-rw-r--r--1 root root 0 October 21:47 new.txt
-rw-r--r--1 root root 0 October 21:47 old.txt

[Email protected]:/tmp# find-type F
./new.txt
./ll.txt
./old.txt
[Email protected]:/tmp# find-type f-name "old"
[Email protected]:/tmp# find-type f-name "old*"
./old.txt
[Email protected]:/tmp# find / -type f-name "old*"
./old.txt
[Email protected]:/tmp# find . -type f-name "old*"
./old.txt


[Email protected]:/tmp# Find. -type f-name "old*" |xargs rm-f
[Email protected]:/tmp# ll
Total Dosage 4
Drwxr-xr-x 2 root root 4096 October 21:50 Lldir
-rw-r--r--1 root root 0 October 21:47 ll.txt
-rw-r--r--1 root root 0 October 21:47 new.txt

[Email protected]:/tmp# Find. -type D
.
./lldir

[Email protected]:/tmp# Find. -type d|grep-v "^\.$"
./lldir


[Email protected]:/tmp# Find. -type d|grep-v "^\.$" |xargs rm-f
RM: Cannot delete "./lldir": is a directory
[Email protected]:/tmp# Find. -type d|grep-v "^\.$" |xargs RM-RF
[Email protected]:/tmp# ll
Total dosage 0
-rw-r--r--1 root root 0 October 21:47 ll.txt
-rw-r--r--1 root root 0 October 21:47 new.txt


[Email protected]:/tmp# mkdir Lldir
[Email protected]:/tmp# !tou
Touch Ll.txt Old.txt New.txt
[Email protected]:/tmp# ll
Total Dosage 4
Drwxr-xr-x 2 root root 4096 October 21:58 Lldir
-rw-r--r--1 root root 0 October 21:59 ll.txt
-rw-r--r--1 root root 0 October 21:59 new.txt
-rw-r--r--1 root root 0 October 21:59 old.txt

[Email protected]:/tmp# ll|find-t
-true-type
[Email protected]:/tmp# ll|find-type F
./new.txt
./ll.txt
./old.txt
[Email protected]:/tmp# ll|find-type D
.
./lldir
[Email protected]:/tmp# find-type D|xargs rm-fr
Rm:refusing to remove "." or ":" Directory:skipping "."

[Email protected]:/tmp# mkdir Lldir
[Email protected]:/tmp# touch ll.txt old.txt new.txt
[Email protected]:/tmp# find-type D|xargs rm-fr 2>01.log
Root[email protected]:/tmp# Cat 01.log
Rm:refusing to remove "." or ":" Directory:skipping "."
[Email protected]:/tmp#







This article comes from the "Dashazi's blog" blog, please be sure to keep this source http://dashazi.blog.51cto.com/10354524/1704694

Daily Tip 2015-10-20

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.