Linux Learning Notes-data lookup, data interception

Source: Internet
Author: User

######### #数据查找 ##########


Find # #find command to locate files in the system
-name # #按照文件名查找
-user # #按照文件属主查找
-group # #按文件属组查找
-perm # #按文件权限查找
-type # #按文件类型查找
# #文件类型: B-Block device C-character device D directory f plain file L link s (socket)
-size N # #查找大小符合n条件的文件
-amin N # #查找系统最后n分钟访问的文件
-atime N # #查找作后n * 24-hour access to files
-cmin N # #查找最后n分钟被改变文件状态的文件
-mmin N # #查找最后n分钟被改变文件数据的文件
Condition 1-o Condition 2 # #查找满足条件1或者条件2
Condition 1-a Condition 2 # #查找满足条件1和条件2
-exec command {} \; # # #对查找出的结果做相应处理


Find path Condition Condition value
eg
Find/mnt-name File # #列出/mnt file named files
Find/mnt-name "file*" # #列出/mnt filename contains file
Find/etc-name "*.conf" # #列出 files with the/mnt file name ending in. conf
find/opt/software/file/-perm 777 # #列出/opt/software/file/file with permission 777
Find./-mmin +1 # #列出当前目录一分钟之前被修改的文件
Find-atime 2 # #查找作后48 =2*24 hours access to files
Find. -type D|sort # #查找当前所有目录并排序
Find/-group mail-exec cp-pr {}/mnt/\; # #在根下找出mail组的文件并复制到 under the/mnt


2.locate # #该命令其实是find an abbreviation for-name, but faster than it, because locate searches for local files contained in the database
# #一般在使用之前要updatedb
Locate + conditions # #在数据库中查找符合条件的文件
UpdateDB # #手动更新数据库

3.whereis # #该命令只用于程序名的搜索, the associated path to the binary program, source code files, and man manuals used to locate instructions
-B # #只查找二进制文件
-B # #只在此目录下查找二进制文件
-M # #只查找说明文件
-S # #只查找原始代码文件

4.which # #该命令用于查找给定命令的绝对路径
eg
which PWD # #查找pwd命令的绝对路径
/bin/pwd


######### #数据截取 ##########
DD If=/dev/zero of=/mnt/file bs=1024 count=10
DD # #数据截取
If # #数据模板
of # #数据存放文件
BS # #数据模板块大小 (per block)
Count # #数据快个数

This article is from the "12148275" blog, please be sure to keep this source http://12158275.blog.51cto.com/12148275/1899932

Linux Learning Notes-data lookup, data interception

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.