Method for querying files under Linux

xiaoxiao2021-03-06  56

Method for querying files under Linux

Find all files starting with PHP in the current directory: find ./ -Name "php *"

Look for a file with greater than 1MB in the current directory and subdirectory: Find ./ Size 1024 (1024 unit is KB)

Find all the files starting with PHP in / var directory: Find / var -Name "PHP *"

Listed all Java files containing the Debug string: grep * .java -l -e "debug"

Listed all Java files that do not contain the Debug string: grep * .java -l -v -e "debug"

Find all Java files that contain debug strings in the current directory: Find -name "* .java" | xargs grep -l -e "debug"

转载请注明原文地址:https://www.9cbs.com/read-114650.html

New Post(0)