2017201708281_grep .txt, 20170828 grep

Source: Internet
Author: User

2017201708281_grep .txt, 20170828 grep

[70708281_grep .txt

-- // Grep is often used to filter display information.

# Ps-ef | grep oraagent
Oracle 13416 1 0 2016? 1-20:48:04/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 17423 1 0 2014? 2-03:32:14/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 21718 1 0 2014? 1-16:45:43/u01/app/11.2.0.4/grid/bin/oraagent. bin
Root 87599 66070 0 00:00:00 pts/0 grep oraagent

-- // There is a small regret that the grep oraagent execution information is also brought out. The common method for many people is
# Ps-ef | grep oraagent | grep-v grep
Oracle 13416 1 0 2016? 1-20:48:05/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 17423 1 0 2014? 2-03:32:15/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 21718 1 0 2014? 1-16:45:43/u01/app/11.2.0.4/grid/bin/oraagent. bin

-- // The actual solution is very simple. The modification is executed as follows:

# Ps-ef | grep oraagen [t]
Oracle 13416 1 0 2016? 1-20:48:04/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 17423 1 0 2014? 2-03:32:15/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 21718 1 0 2014? 1-16:45:43/u01/app/11.2.0.4/grid/bin/oraagent. bin

-- // The actual grep is used to filter and display information or oraagent. In this case, grep oraagen [t] is used to execute grep commands. In this way, the required information is displayed if the grep command does not meet the filtering condition oraagent.
-- // Information.

-- // For the following questions, add the header to display the ps-ef. Generally, use egrep.

# Ps-ef | egrep "oraagent | UI [D]"
UID PID PPID C STIME TTY TIME CMD
Oracle 13416 1 0 2016? 1-20:48:08/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 17423 1 0 2014? 2-03:32:16/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 21718 1 0 2014? 1-16:45:45/u01/app/11.2.0.4/grid/bin/oraagent. bin
Root 111809 66070 0 00:00:00 pts/0 egrep oraagent | UI [D]

-- // But in this way, the egrep oraagent | UI [D] is brought out. In fact, if you define grep-related environment variables, you can see the color of the display to understand the problem.

# Env | grep-I grep _
GREP_COLOR = 01; 32
GREP_OPTIONS = -- color = auto

-- // In this way, oraagent is green. The modification is as follows:
# Ps-ef | egrep "oraagen [t] | UI [D]"
UID PID PPID C STIME TTY TIME CMD
Oracle 13416 1 0 2016? 1-20:48:09/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 17423 1 0 2014? 2-03:32:17/u01/app/11.2.0.4/grid/bin/oraagent. bin
Grid 21718 1 0 2014? 1-16:45:45/u01/app/11.2.0.4/grid/bin/oraagent. bin

-- // This is OK, and there may be many ways to do it! Pai_^ .'

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.