Ten Linux commands you don't know (1)

Source: Internet
Author: User

The following may be the ten Linux commands you have never used. Very useful.

1) pgrep

There is a p in front of the pgrep name. We can guess that it is related to the process, and it is also a grep command related to the process. However, this command is mainly used to list process IDs. For example:

$ pgrep -u hchen2244122444

This command is equivalent:

1 ps -ef | egrep '^hchen' | awk '{print $2}'

2) pstree

This command can list processes in a tree. As follows:

[hchen@RHELSVR5 ~]$ pstreeinit-+-acpid|-auditd-+-python| `-{auditd}|-automount---4*[{automount}]|-backup.sh---sleep|-dbus-daemon|-events/0|-events/1|-hald---hald-runner---hald-addon-acpi|-httpd---10*[httpd]|-irqbalance|-khelper|-klogd|-ksoftirqd/0|-ksoftirqd/1|-kthread-+-aio/0|-aio/1|-ata/0|-ata/1|-ata_aux|-cqueue/0|-cqueue/1|-kacpid|-kauditd|-kblockd/0|-kblockd/1|-kedac|-khubd|-6*[kjournald]|-kmirrord|-kpsmoused|-kseriod|-kswapd0|-2*[pdflush]|-scsi_eh_0|-scsi_eh_1|-xenbus| `-xenwatch|-migration/0|-migration/1|-6*[mingetty]|-3*[multilog]|-mysqld_safe---mysqld---9*[{mysqld}]|-smartd|-sshd---sshd---sshd---bash---pstree|-svscanboot---svscan-+-3*[supervise---run]|-supervise---qmail-send-+-qmail-clean|-qmail-lspawn| `-qmail-rspawn| `-2*[supervise---tcpserver]|-syslogd|-udevd|-watchdog/0|-watchdog/1-xinetd


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.