1. Recursively query a file containing a string in the specified folder (the file content fragment listed)
grep-r "string to find" file path
such as: Grep-r "HelloWorld". #在当前目录下递归查找 "HelloWorld" string
2. recursively find file names (list file names)
such as: Find. -name "*.log" #在当前目录中递归列出以log为扩展名的文件
3 . Viewing the number of operating system bits
Arch
4. String Simple intercept operation
such as: str= "Com.baidu.android.lulei"
1. Get the tail of a string
${str##*.} Get "Lulei" (# #最大限度截取 *.)
${str#*.} Get "Baidu.android.lulei" (#最小限度截取 *.)
${str##*l} get "ei" (Maximum intercept *l)
2. Get the header of a string
${str%%.*} get "com"(percent of maximum intercept *.)
${str%.*} get "com.baidu.android"(% minimum intercept *.)
${str%%.i*} get "com.ba"(maximum intercept *l)
3. Specify location acquisition
${str:0:3} get "com" (3 characters from 1th bit)
${str:4} Get "Baidu.android.lulei" (starting from 5th intercept to end)
${STR:0-5} Get "Lulei" (Intercept from the bottom 5th to the end)
${str:0-5:5} Get "Lulei" (5 bits starting from the 5th digit)
Linux Common Command Quick check