当前位置:网站首页>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
边栏推荐
- 数据库系统原理与应用教程(001)—— MySQL 安装与配置:MySQL 软件的安装(windows 环境)
- PostgreSQL 存储结构浅析
- 怎麼用MySQL語言進行行列裝置?
- China's intelligent transportation construction from the perspective of "one hour life circle" in Dawan District
- 全面看待企业数字化转型的价值
- There will be a gap bug when the search box and button are zoomed
- Principes et applications du système de base de données (006) - - compilation et installation de MySQL 5.7 (environnement Linux)
- [nodemon] app crashed - waiting for file changes before starting...解决方法
- Solution to the problem that the keypad light does not light up when starting up
- DO280管理应用部署--pod调度控制
猜你喜欢

普通二本,去过阿里外包,到现在年薪40W+的高级测试工程师,我的两年转行心酸经历...

为国产数据库添砖加瓦,StoneDB 一体化实时 HTAP 数据库正式开源!

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

Tutorial on principles and applications of database system (006) -- compiling and installing MySQL 5.7 (Linux Environment)

接口测试框架中的鉴权处理

【SQL语句】请问这边为什么select出了两个上海,查询出了不同的count我想让他变成一个上海,count只显示一个总和

Germany if was crowned with many awards. How strong is this pair of headphones? In depth evaluation of yinpo GTW 270 hybrid

VMware 虚拟机启动时出现故障:VMware Workstation 与 Hyper-v 不兼容...

【Hot100】20. Valid parentheses

【Hot100】17. 电话号码的字母组合
随机推荐
Why is the pkg/errors tripartite library more recommended for go language error handling?
Im instant messaging develops a message delivery scheme for 10000 people
picgo快捷键 绝了这人和我的想法 一模一样
Principle of motion capture system
Zabbix2.2监控之系统及应用日志监控报警
The sharp drop in electricity consumption in Guangdong shows that the substitution of high-tech industries for high-energy consumption industries has achieved preliminary results
【Hot100】19. 删除链表的倒数第 N 个结点
In the era of super video, what kind of technology will become the base?
數據庫系統原理與應用教程(006)—— 編譯安裝 MySQL5.7(Linux 環境)
芯片供应转向过剩,中国芯片日产增加至10亿,国外芯片将更难受
The Department came to a Post-00 test paper king who took out 25K. The veteran said it was really dry, but it had been
数据库系统原理与应用教程(006)—— 编译安装 MySQL5.7(Linux 环境)
普通二本,去过阿里外包,到现在年薪40W+的高级测试工程师,我的两年转行心酸经历...
IM即时通讯开发实现心跳保活遇到的问题
今天14:00 | 港大、北航、耶鲁、清华、加大等15位ICLR一作讲者精彩继续!
虚拟串口模拟器和串口调试助手使用教程「建议收藏」
She is the "HR of others" | ones character
IM即时通讯开发万人群聊消息投递方案
学会了selenium 模拟鼠标操作,你就可以偷懒点点点了
Idea start command line is too long problem handling