Simple usage of some commands in Linux

echo

Function: display a line of text (display a line of text)

Example:

 echo view help

Example:

grep

The Linux grep (global regular expression) command is used to find qualified strings or regular expressions in files. If no file name is specified, or if the file name - is given, the grep command reads data from the standard input device.

More explanations and examples

grammar

grep [options] pattern [files]
  • pattern - Indicates the string or regular expression to look for.
  • files - Indicates the name of the file to be searched. Multiple files can be searched at the same time. If the files parameter is omitted, the data will be read from the standard input by default.

Example 1:

Explanation: Find the string named twinkle in greped.txt

Example 2:

Explanation: The anonymous pipeline  | uses   the output of  the echo the world is nice command as  the input data of the grep "the world" command.

ps

The Linux ps (full spelling in English: process status) command is used to display the status of the current process, similar to the task manager of windows.

More explanations and examples

grammar

ps [options] [--help]

Example: Find the specified process format

ps -ef | grep 进程关键字

Explanation: Display the process of php

Guess you like

Origin blog.csdn.net/weixin_43732022/article/details/131047262