当前位置:网站首页>Rhcsa Road
Rhcsa Road
2022-07-01 16:34:00 【Omniscient magical conch】
The fourth day
File search 4 Ways of planting
whereis The query scope searches for files through the path of system environment variables $PATH, All documents
[[email protected] ~]# whereis ls
ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz
[[email protected] ~]# whereis pwd
pwd: /usr/bin/pwd /usr/share/man/man1/pwd.1.gz /usr/share/man/man1p/pwd.1p.gzwhich The query scope searches for files through the path of system environment variables $PATH, Looking for executable ( Find command file )
[[email protected] ~]# which locate
/usr/bin/locate
[[email protected] ~]# which whereis
/usr/bin/whereislocate Global search , But you need to import the system files into the database before searching updatedb; Fast search speed
[[email protected] ~]# locate whereis
/usr/bin/whereis
/usr/share/bash-completion/completions/whereis
/usr/share/man/man1/whereis.1.gz*find Global search for files .
Parameters | effect |
-name | Match name |
-perm 644 | Match permissions (mode For a perfect match ,-mode Just for inclusion ) |
-user | Match users |
-group | Match all groups |
-mtime -n +n | Match when the content was modified (-4 Means less than or equal to 4 File name within days ;+4, Greater than or equal to 5 Documents before name ;4 Forefinger 4~5 The documents of that day ) |
-atime -n +n | Match access time to file |
-ctime -n +n | Match when the file permission was modified |
-nouser | Match files without owner |
-nogroup | Match files without all groups |
-newer f1 !f2 | Matching ratio file f1 New than f2 Old documents |
-type b/d/c/p/l/f | Match file type ( The following alphanumeric parameters in turn represent block devices 、 Catalog 、 Character device 、 The Conduit 、 link file 、 text file ) |
-size | Match file size (+50KB To find more than 50KB The file of , and -50KB To find less than 50KB The file of ) |
prune | Ignore a directory |
-exec …… {}\; | This can be followed by commands for further processing of search results |
matters needing attention :
find Find the directory of the file -path Directory to exclude -prune -o -name What to query
1)-prune It has to be with -path,-o Use it together
2)-prune -o The order is not Can exchange
3)-name Etc. must be placed in -prune -o You can use it later
eg: find . -path ./tmp -prune -o -name "*.txt"
1. Search by filename
[[email protected] ~]# find Search path [ Options ] Search content
Options :
-name: Search by filename
-iname: Search by filename , Case insensitive file names
-inum: according to inode Search on [[email protected] ~]# find Search path [ Options ] Search content
Options :
-size [+|-] size : Search for files of the specified size there “+” Search for files larger than the specified size , “-” Search for a text smaller than the specified size Pieces of [[email protected] ~]# find Search path [ Options ] Search content
Options :
-atime [+|-] Time : Search by file access time
-mtime [+|-] Time : Search by file data modification time
-ctime [+|-] Time : Search according to file status modification time File compression and decompression
tar Filing order
Options | function |
| c | establish .tar In the form of Bao Wenjian |
| x | Release .tar In the form of Bao Wenjian |
| t | View the list of files in the package |
| v | Indicates that detailed prompt information is displayed when the command is executed |
f Baowen Piece name | Used to specify the package file name . When and -c When used with options , Created tar The package file uses the file name specified by this option ; When and -x When used with options , Release the... Specified by this option tar Package file |
| p | Preserve the permissions of files and directories when packaging |
| z | call gzip Program , With gzip Compress or decompress the file in the format . |
| j | call bzip2 Program , With bzip2 Compress or decompress the file in the format . |
| J | Use xz Compress (.tar.xz).xz The compression ratio is usually higher than bzip2 Higher . |
C Catalog route name | When releasing a package, specify the location of the target to be released . |
alias Define command aliases
Command cache
1. Build command cache
Execute the command to automatically create in the cache
hash -p /usr/bin/touch touch
hash -p /usr/bin/touch chuangjian
2. Delete cache
hash -d chuangjian
hash -r Empty all caches
exit terminal
Caching features : Command cache ---alias-- Name order document
[[email protected] ~]# hash
hits command
3 /usr/bin/vim
1 /usr/bin/cat
1 /usr/sbin/pidof
2 /usr/bin/su
[[email protected] ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[[email protected] ~]# which touch
/usr/bin/touch
[[email protected] ~]# touch a
[[email protected] ~]# hash
hits command
3 /usr/bin/vim
1 /usr/bin/cat
1 /usr/bin/touch
1 /usr/sbin/pidof
2 /usr/bin/su
[[email protected] ~]# touch /usr/bin/touch ---= Priority through cache matching
[[email protected] ~]# hash
hits command
3 /usr/bin/vim
1 /usr/bin/cat
2 /usr/bin/touch
1 /usr/sbin/pidof
2 /usr/bin/su
[[email protected] ~]# mv /usr/bin/touch /usr/local/bin
[[email protected] ~]# touch b
bash: /usr/bin/touch: No such file or directory
[[email protected] ~]# hash -d touch
[[email protected] ~]# hash
hits command
3 /usr/bin/vim
1 /usr/bin/cat
1 /usr/sbin/pidof
3 /usr/bin/mv
2 /usr/bin/su
[[email protected] ~]# touch b ---- There is no cache and the command file under the alias execution environment variable path
[[email protected] ~]# hash -p /usr/bin/tac chakan -- Alias
history
边栏推荐
- Five years after graduation, I became a test development engineer with an annual salary of 30w+
- Principes et applications du système de base de données (006) - - compilation et installation de MySQL 5.7 (environnement Linux)
- Stonedb is building blocks for domestic databases, and the integrated real-time HTAP database based on MySQL is officially open source!
- Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
- Go language source level debugger delve
- Microservice tracking SQL (support Gorm query tracking under isto control)
- Why is the pkg/errors tripartite library more recommended for go language error handling?
- Germany if was crowned with many awards. How strong is this pair of headphones? In depth evaluation of yinpo GTW 270 hybrid
- Where should older test / development programmers go? Will it be abandoned by the times?
- 复杂度相关OJ题(LeetCode、C语言、复杂度、消失的数字、旋转数组)
猜你喜欢

【直播预约】数据库OBCP认证全面升级公开课

瑞典公布决定排除华为5G设备,但是华为已成功找到新出路

Where should older test / development programmers go? Will it be abandoned by the times?

SQLServer查询: a.id与b.id相同时,a.id对应的a.p在b.id对应的b.p里找不到的话,就显示出这个a.id和a.p

Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world

idea启动Command line is too long问题处理

VMware 虚拟机启动时出现故障:VMware Workstation 与 Hyper-v 不兼容...
![[observation] where is the consulting going in the digital age? Thoughts and actions of softcom consulting](/img/82/3bb382893682a30e8af130365ec4ef.jpg)
[observation] where is the consulting going in the digital age? Thoughts and actions of softcom consulting

【Hot100】17. 电话号码的字母组合

How to use MySQL language for row and column devices?
随机推荐
Zabbix2.2 monitoring system and application log monitoring alarm
Authentication processing in interface testing framework
Red team Chapter 8: blind guess the difficult utilization process of the package to upload vulnerabilities
博睿数据一体化智能可观测平台入选中国信通院2022年“云原生产品名录”
Go language source level debugger delve
IM即時通訊開發實現心跳保活遇到的問題
China's intelligent transportation construction from the perspective of "one hour life circle" in Dawan District
[daily news]what happened to the corresponding author of latex
Embedded development: five revision control best practices
2022 Moonriver global hacker song winning project list
Share the daily work and welfare of DJI (Shenzhen headquarters) in Dajiang
运动捕捉系统原理
ABAP call restful API
FPN network details
Problèmes rencontrés dans le développement de la GI pour maintenir le rythme cardiaque en vie
Go 语言怎么使用对称加密?
FPN网络详解
Tutorial on the principle and application of database system (001) -- MySQL installation and configuration: installation of MySQL software (Windows Environment)
I'm a senior test engineer who has been outsourced by Alibaba and now has an annual salary of 40w+. My two-year career changing experience is sad
Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?