Current location - Quotes Website - Team slogan - Linux search command
Linux search command
Linux uses grep to find commands containing two keywords?

Grep seems to search only plain text files. If you want to search the text in doc, you can download an antiword tool. Antiwordtest.doc|grep' keyword '

How to find a string in a file under linux?

The Grep command is the most suitable command for finding strings in documents. Enter the command directly in the terminal without opening the file. The format is: the file name of a string enclosed by a single user in grep. Example: there are several useful parameters in the grep'abcdef'helloworld.pygrep command: -i parameter: indicating that the case of the search string is ignored. -n parameter: indicates the line number of the output result. -c parameter: Use single quotation marks to calculate the number of known strings.

Does Linux check whether tomcat port is occupied?

Mine: linux needs to use the command of netstat-ano|grep port number to check whether the tomcat port is occupied.

Generally, the port used by tomcat is in the configuration file under the installation directory, which is located in Tomcat's installation directory /conf/server.xml file. The general code is as follows:

connector port = 8080 protocol = HTTP/ 1. 1 connection time out = 20000 redirect port = 8443/>

TCP8080 port is tomcat's stat-plantup|grep8080, so you can see whether Tomcat's port is open or occupied.

Then use fuser-v8080/tcp to find out which program or process is occupied by tomcat's port.

What does kalilinux think of the network?

Ifconfig|grepaddr There is a lot of information after ifconfig, eth0, eth01. . . Each eth* represents a network card.

What command is used to find a string in linux?

Linux uses grep command to search for strings, which can find files or find them in the results of the command. If you look for a string in a file, the usage is:

Grep string file name enclosed in English single quotation marks

If you look for it in the displayed results of the command, you need to connect the command with grep with pipe characters, like this:

last|grep'root '

(Find the string root in the display result of the last command)