当前位置:网站首页>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.gz
which 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/whereis
locate 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
边栏推荐
- When ABAP screen switching, refresh the previous screen
- Principes et applications du système de base de données (006) - - compilation et installation de MySQL 5.7 (environnement Linux)
- Uncover the "intelligence tax" of mousse: spend 4billion on marketing, and only 7 invention patents
- Principle of motion capture system
- Tutorial on the principle and application of database system (001) -- MySQL installation and configuration: installation of MySQL software (Windows Environment)
- 你还在用收费的文档管理工具?我这有更牛逼的选择!完全免费
- Stonedb is building blocks for domestic databases, and the integrated real-time HTAP database based on MySQL is officially open source!
- 【Hot100】17. Letter combination of telephone number
- EndeavourOS移动硬盘安装
- 从大湾区“1小时生活圈”看我国智慧交通建设
猜你喜欢
近半年内连获5家“巨头”投资,这家智能驾驶“黑马”受资本追捧
[每日一氵]Latex 的通讯作者怎么搞
接口测试框架中的鉴权处理
C#/VB. Net merge PDF document
How to write good code - Defensive Programming Guide
Apple's self-developed baseband chip failed again, which shows Huawei Hisilicon's technological leadership
Korean AI team plagiarizes shock academia! One tutor with 51 students, or plagiarism recidivist
數據庫系統原理與應用教程(006)—— 編譯安裝 MySQL5.7(Linux 環境)
Use Tencent cloud to build a map bed service
Endeavouros mobile hard disk installation
随机推荐
Embedded development: five revision control best practices
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
Microservice tracking SQL (support Gorm query tracking under isto control)
【Hot100】17. Letter combination of telephone number
Principes et applications du système de base de données (006) - - compilation et installation de MySQL 5.7 (environnement Linux)
She is the "HR of others" | ones character
Tutorial on the principle and application of database system (003) -- MySQL installation and configuration: manually configure MySQL (Windows Environment)
PostgreSQL 存储结构浅析
毕业后5年,我成为了年薪30w+的测试开发工程师
Telecommuting experience? Let's introduce ourselves ~ | community essay solicitation
【直播预约】数据库OBCP认证全面升级公开课
圈铁发音,动感与无噪强强出彩,魔浪HIFIair蓝牙耳机测评
Action after deleting laravel's model
Is it reliable to open an account on flush with mobile phones? Is there any potential safety hazard
[nodemon] app crashed - waiting for file changes before starting...解决方法
Comment utiliser le langage MySQL pour les appareils de ligne et de ligne?
Zabbix2.2 monitoring system and application log monitoring alarm
[daily question] 1175 Prime permutation
Authentication processing in interface testing framework
为国产数据库添砖加瓦,StoneDB 一体化实时 HTAP 数据库正式开源!