File Lookup method
[email protected] ~]# which useradd #查看可执行文件位置
/usr/sbin/useradd
[Email protected] ~]# Whereis!$ #查看可执行文件的位置以及相关文件
Whereis Useradd
Useradd:/usr/sbin/useradd/usr/share/man/man8/useradd.8.gz
grep filtering
#grep ^# a.txt #以 # Start Display
#grep ^$ a.txt #显示空行
[Email protected] ~]# vim a.txt
1111111111111
2222222222222
3333333333333
4444444444444
5555555555555
6666666666666
7777777777777
8888888888888
9999999999999
~
~
[[email protected] ~]# grep 5 a.txt
5555555555555
[Email protected] ~]# grep-v 5 a.txt #反选
1111111111111
2222222222222
3333333333333
4444444444444
6666666666666
7777777777777
8888888888888
9999999999999
Find
The Find command searches for a file in the directory structure and performs the specified action
The Find command provides quite a few look-up conditions and is powerful.
-name< template style;: Specifies a string as a template style for searching for a file or directory;
-perm< permission value;: Find the file or directory that matches the specified permission value;
-mtime<24 hours;: Find files or directories that have been changed at a specified time, measured in 24 hours;
-user< name of the owner;: a file or directory for the Finder and the specified owner name
-size< file size;: Find files that match the specified file size;
-type finding a file of a certain type
B-Block device files
D-Catalog
C-Character device files
P-Piping File
F-Normal file
L-Symbolic Link file
Linux commands 13