Starting from a Linux grep command, linuxgrep
During Development today, I saw my colleagues using such a linux Command.
grep 'class YourClass' -rwi * |grep -v svn
Think of the grep command, several parameters.
-R explicitly re
Linux Text processing the Three Musketeers grep egrepGrep:global search REgular expression andprint out of the line.function: Text Search tool, according to user-specified "mode (pattern) "Go through the line to search for the target text and print the matching lines."pattern: An metacharacters character written by a regular expression and a literal character, where the regular expression is a basic regular
Command format:grep [options] Find condition directory file
Command function:For filtering, searching for specific characters
Common options:-A (number) displays the (number) row after the line, in addition to the line that matches the criteria- B (number) displays the line before the line, in addition to the line that matches the criteria- C (number) displays the front and back (number) lines of the row, in addition to the line that matches the criteria -I ignore case when searching- v show
The search commands under Linux are mainly found and grep, and the two are different: The Find command is based on the properties of the file , such as file name, file size, owner, owning group, whether it is empty, access time, modification time, etc.grep is a lookup based on the contents of the file, and each line of the file is matched in a given pattern (patter).1.find Command Basic format:Find path -na
Reprint: http://blog.sina.com.cn/s/blog_62e7fe670101dg9d.html Linux find a method that matches multiple keywords in GREP at a time by finding multiple specified files or excluding certain types of files(1) Linux find more than one specified file at a time:Find a.html and b.html
Find. -name "a.html"-name "b.html"
Find. -regex '. *\.txt\|. *\.doc\|
matching string to the output (the row number of the first line of the file is 1)
-V: only display rows that do not contain matching strings.
-F filename: Gets the search mode from the specified file. each row contains one search mode item.
Example: [roo @ locallost user1] # grep printf *. c
Find the printf string in all C files in the current directory
Example: [roo @ locallost user1] # grep user1/ect/pas
expression regexpMetacharacters.: Matches any single character[]: matches a single character within a specified range[^]: matches any single character outside the specified rangeNumber of matches:*: matches the preceding character any time. *: Matches any character\? Match the preceding character 1 or 0 times+: Match the preceding character at least 1 times{M,n}: match the preceding character[Email protected] ~]# Cat/tmp/t.txtIt is open no opening###########Location Anchorage^: Anchoring the be
forcibly close the process that occupies the port:# Netstat-tlnpa | grep 44444tcp6 0 0 10.58.242.18:44444 :::* LISTEN 25049/javaThe port query result is like the above format, then we can write the following script according to this format:pinfo= ' Netstat-tlnpa | grep 44444 ' pid= ' awk ' {split ("' $pinfo '", Array, "/");p rint array[2]} "if [!-Z" $PID "]; Then
matching text.-V: Displays all lines that do not contain matching text. Pattern Regular Expression Main parameters:\: Ignores the original meaning of special characters in regular expressions.^: matches the start line of the regular expression.$: Matches the end line of the regular expression.\\>: End of line to match regular expression.[]: A single character, such as [a], a meets the requirements.[-]: range, such as [A-z], i.e. A, B, C to Z all meet the requirements..: all the individual ch
http://www.vaikan.com/use-multiple-cpu-cores-with-your-linux-commands/Have you ever had to calculate a very large data (hundreds of GB) requirement? Or search inside, or anything else--something that can't be done in parallel. Data experts, I'm talking to you. You may have a 4-core or more core CPU, but our appropriate tools, such as grep, bzip2, WC, awk, sed , and so on, are single-threaded, Only one CPU c
GrepThe grep command in a Linux system is a powerful text search tool that uses regular expressions to search for text and match lines to print.Command syntax:Usage:grep [-ABCDEFGHHIIJLLMNOOQRSSUVVWXZ] [-A num] [-b num] [-c[num][-E Pattern] [-F file] [--binary-files=value] [--color=when][--context[=num]] [--directories=action] [--label] [--line-buffered][--null] [Pattern] [File ...]Command instance:-C: Calc
contain numbers:grep ' [0-9] '/etc/inittabFilter out all rows that do not contain numbers:Grep-v ' [0-9] '/etc/inittabRemove all lines that begin with ' # ':Grep-v ' ^# '/etc/inittabRemove all empty lines and lines that begin with ' # ':Grep-v ' ^# '/etc/crontab |grep-v ' ^$ 'How to print a line that does not start with the English lettergrep ' ^[^a-za-z] ' test
-tomcat-6.0.16- Djava.io.tmpdir=/usr/local/apache-tomcat-6.0.16/temp org.apache.catalina.startup.Bootstrap StartRoot 27120 27015 0 13:23 pts/4 00:00:00 grep javaView all the Java-related processes with the following command:Get as on-line.When the associated process is received, a thread is terminated with theKill-9XXXXX for the above-listed serial numbers such as: 19979 thread termination: kill-9 19979Enter the following command to view the process a
] updatedb]# PS aux|grep./update_stockroot 14232 0.0 0.0 5928 724 pts/1 s+ 18:16 0:00 gr Ep./update_stockroot 25021 0.0 0.0 3056 816? S Apr12 0:03./update_stockps aux output format: User PID%cpu%MEM VSZ RSS TTY STAT START Time command Format Description: User: Trip owner Pi D:PID%CPU: CPU usage%mem: Consumed memory usage vsz: Virtual memory size consumed RSS: Memory size used by TTY: the secondary device number of the terminal (minor device numbers of
a , function : the grep command in a Linux system is a powerful text search tool that uses regular expressions to search for text and print matching lines . Second, usage:grep [Options] ... PATTERN [FILE] ...Find the PATTERN in each file or standard input. The default PATTERN is a basic regular expression (abbreviated to BRE).For example:Grep-i ' Hello World ' menu.h main.cThree, the main parameters: -G,
Background: Linux Under the hardware there are a lot of how to see the NIC is what kind of, the sound card is what kind of a few USB port and brand.
[Root@emulmachine htdocs]# lspci |grep usb 00:03.0
usb controller:broadcom BCM5785 [HT1000] USB (rev. 00:03.1)
USB controller:broadcom BCM5785 [HT1000] USB (rev)
00:03.2 USB controller:broadcom BCM5785 [HT1000] USB (rev 01)
The command action: LSPCI the outpu
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.