Linux commands 13

Source: Internet
Author: User

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

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.