通配符(管道符)

通配符(管道符)1 管道符 管道符的符号 管道符的作用 是用于两个命令或者多个命令相链接 将前边的命令的执行结果传递到后边的命令 例如 查看 home 目录里的所有的文件 root localhost ls al home 统计 home 里一共有多少文件

大家好,我是讯享网,很高兴认识大家。

1、管道符

管道符的符号:|

管道符的作用:是用于两个命令或者多个命令相链接,将前边的命令的执行结果传递到后边的命令

例如:

#查看home目录里的所有的文件

[root@localhost /]# ls -al /home

#统计home里一共有多少文件

[root@localhost /]# ls -al /home | wc -l

#查看当前系统登录用户的数量

[root@localhost home]# who | wc -l

案例2:结合grep命令使用管道符

#获取ip地址在哪一行

[root@localhost home]# ifconfig ens33 | grep netmask

#显示passwd中以root为开头的行

方法一:[root@localhost home]# cat /etc/passwd | grep "^root"

方法二:[root@localhost home]# grep "^root" /etc/passwd


讯享网

ps命令:

      ps的作用:显示当前系统的进程信息

[root@localhost home]# ps aux
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          1  0.0  0.5  5028 ?        Ss   02:21   0:06 /usr/lib/systemd/systemd --switched-root --syste
root          2  0.0  0.0      0     0 ?        S    02:21   0:00 [kthreadd]
root          4  0.0  0.0      0     0 ?        S<   02:21   0:00 [kworker/0:0H]
root          6  0.0  0.0      0     0 ?        S    02:21   0:02 [ksoftirqd/0]
root          7  0.0  0.0      0     0 ?        S    02:21   0:00 [migration/0]
root          8  0.0  0.0      0     0 ?        S    02:21   0:00 [rcu_bh]
root          9  0.0  0.0      0     0 ?        R    02:21   0:03 [rcu_sched]
root         10  0.0  0.0      0     0 ?        S<   02:21   0:00 [lru-add-drain]
root         11  0.0  0.0      0     0 ?        S    02:21   0:00 [watchdog/0]
root         13  0.0  0.0      0     0 ?        S    02:21   0:00 [kdevtmpfs]
root         14  0.0  0.0      0     0 ?        S<   02:21   0:00 [netns]
root         15  0.0  0.0      0     0 ?        S    02:21   0:00 [khungtaskd]
root         16  0.0  0.0      0     0 ?        S<   02:21   0:00 [writeback]
root         17  0.0  0.0      0     0 ?        S<   02:21   0:00 [kintegrityd]
root         18  0.0  0.0      0     0 ?        S<   02:21   0:00 [bioset]
root         19  0.0  0.0      0     0 ?        S<   02:21   0:00 [bioset]
root         20  0.0  0.0      0     0 ?        S<   02:21   0:00 [bioset]
root         21  0.0  0.0      0     0 ?        S<   02:21   0:00 [kblockd]
root         22  0.0  0.0      0     0 ?        S<   02:21   0:00 [md]
root         23  0.0  0.0      0     0 ?        S<   02:21   0:00 [edac-poller]
root         24  0.0  0.0      0     0 ?        S<   02:21   0:00 [watchdogd]
root         30  0.0  0.0      0     0 ?        S    02:21   0:03 [kswapd0]
root         31  0.0  0.0      0     0 ?        SN   02:21   0:00 [ksmd]
root         32  0.0  0.0      0     0 ?        SN   02:21   0:00 [khugepaged]
root         33  0.0  0.0      0     0 ?        S<   02:21   0:00 [crypto]
root         41  0.0  0.0      0     0 ?        S<   02:21   0:00 [kthrotld]
root         43  0.0  0.0      0     0 ?        S<   02:21   0:00 [kmpath_rdacd]
root         44  0.0  0.0      0     0 ?        S<   02:21   0:00 [kaluad]
root         45  0.0  0.0      0     0 ?        S<   02:21   0:00 [kpsmoused]
root         47  0.0  0.0      0     0 ?        S<   02:21   0:00 [ipv6_addrconf]
root         60  0.0  0.0      0     0 ?        S<   02:21   0:00 [deferwq]
root         97  0.0  0.0      0     0 ?        S    02:21   0:00 [kauditd]
root        278  0.0  0.0      0     0 ?        S<   02:21   0:00 [mpt_poll_0]
root        279  0.0  0.0      0     0 ?        S<   02:21   0:00 [mpt/0]
root        280  0.0  0.0      0     0 ?        S<   02:21   0:00 [nfit]
root        281  0.0  0.0      0     0 ?        S<   02:21   0:00 [ata_sff]
root        284  0.0  0.0      0     0 ?        S    02:21   0:00 [scsi_eh_0]
root        285  0.0  0.0      0     0 ?        S<   02:21   0:00 [scsi_tmf_0]
root        290  0.0  0.0      0     0 ?        S    02:21   0:00 [scsi_eh_1]
root        291  0.0  0.0      0     0 ?        S<   02:21   0:00 [scsi_tmf_1]
root        293  0.0  0.0      0     0 ?        S    02:21   0:00 [scsi_eh_2]
root        294  0.0  0.0      0     0 ?        S<   02:21   0:00 [scsi_tmf_2]
root        301  0.0  0.0      0     0 ?        S    02:21   0:00 [irq/16-vmwgfx]
root        302  0.0  0.0      0     0 ?        S<   02:21   0:00 [ttm_swap]
root        373  0.0  0.0      0     0 ?        S<   02:21   0:00 [kdmflush]
root        374  0.0  0.0      0     0 ?        S<   02:21   0:00 [bioset]
root        383  0.0  0.0      0     0 ?        S<   02:21   0:00 [kdmflush]
root        384  0.0  0.0      0     0 ?        S<   02:21   0:00 [bioset]
root        397  0.0  0.0      0     0 ?        S<   02:21   0:00 [bioset]
root        398  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfsalloc]
root        399  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs_mru_cache]
root        400  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-buf/dm-0]
root        401  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-data/dm-0]
root        402  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-conv/dm-0]
root        403  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-cil/dm-0]
root        404  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-reclaim/dm-]
root        405  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-log/dm-0]
root        406  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-eofblocks/d]
root        407  0.0  0.0      0     0 ?        S    02:21   0:35 [xfsaild/dm-0]
root        408  0.0  0.0      0     0 ?        S<   02:21   0:00 [kworker/0:1H]
root        490  0.0  0.4  37816  4044 ?        Ss   02:21   0:01 /usr/lib/systemd/systemd-journald
root        514  0.0  0.0   676 ?        Ss   02:21   0:00 /usr/sbin/lvmetad -f
root        530  0.0  0.1  49292  1896 ?        Ss   02:21   0:00 /usr/lib/systemd/systemd-udevd
root        567  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-buf/sda1]
root        569  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-data/sda1]
root        570  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-conv/sda1]
root        571  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-cil/sda1]
root        572  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-reclaim/sda]
root        573  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-log/sda1]
root        575  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-eofblocks/s]
root        579  0.0  0.0      0     0 ?        S    02:21   0:00 [xfsaild/sda1]
root        589  0.0  0.0      0     0 ?        S<   02:21   0:00 [kdmflush]
root        590  0.0  0.0      0     0 ?        S<   02:21   0:00 [bioset]
root        649  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-buf/dm-2]
root        650  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-data/dm-2]
root        651  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-conv/dm-2]
root        652  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-cil/dm-2]
root        653  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-reclaim/dm-]
root        654  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-log/dm-2]
root        655  0.0  0.0      0     0 ?        S<   02:21   0:00 [xfs-eofblocks/d]
root        656  0.0  0.0      0     0 ?        S    02:21   0:00 [xfsaild/dm-2]
root        689  0.0  0.0  55532   564 ?        S<sl 02:21   0:00 /sbin/auditd
root        691  0.0  0.0  84556   792 ?        S<sl 02:21   0:00 /sbin/audispd
root        693  0.0  0.0  55624   988 ?        S<   02:21   0:00 /usr/sbin/sedispatch
root        695  0.0  0.0      0     0 ?        S<   02:21   0:00 [rpciod]
root        696  0.0  0.0      0     0 ?        S<   02:21   0:00 [xprtiod]
root        717  0.0  0.4  4480 ?        Ssl  02:21   0:00 /usr/sbin/ModemManager
root        718  0.0  0.5  5640 ?        Ssl  02:21   0:00 /usr/libexec/udisks2/udisksd
root        722  0.0  0.3  2988 ?        Ssl  02:21   0:00 /usr/libexec/accounts-daemon
root        724  0.0  0.1  26440  1496 ?        Ss   02:21   0:00 /usr/lib/systemd/systemd-logind
polkitd     725  0.0  0.7  7216 ?        Ssl  02:21   0:01 /usr/lib/polkit-1/polkitd --no-debug
root        728  0.0  0.0  52792   972 ?        Ss   02:21   0:00 /usr/sbin/smartd -n -q never
avahi       731  0.0  0.1  62264  1524 ?        Ss   02:21   0:00 avahi-daemon: running [linux.local]
rtkit       733  0.0  0.1  1096 ?        SNsl 02:21   0:00 /usr/libexec/rtkit-daemon
root        734  0.0  0.0   680 ?        Ssl  02:21   0:00 /usr/sbin/gssproxy -D
root        740  0.0  0.1  57612  1648 ?        Ss   02:21   0:00 /usr/libexec/bluetooth/bluetoothd
root        744  0.0  0.1  1648 ?        Ss   02:21   0:00 /usr/sbin/abrtd -d -s
root        745  0.0  0.1  1660 ?        Ss   02:21   0:00 /usr/bin/abrt-watch-log -F BUG: WARNING: at WARN
dbus        753  0.0  0.3  70968  3572 ?        Ssl  02:21   0:03 /usr/bin/dbus-daemon --system --address=systemd:
avahi       756  0.0  0.0  62140    40 ?        S    02:21   0:00 avahi-daemon: chroot helper
root        775  0.0  0.0  16900   668 ?        SNs  02:21   0:00 /usr/sbin/alsactl -s -n 19 -c -E ALSA_CONFIG_PAT
libstor+    778  0.0  0.0   8580   568 ?        Ss   02:21   0:00 /usr/bin/lsmd -d
root        781  0.0  0.1  1108 ?        Ss   02:21   0:00 /usr/bin/VGAuthService -s
root        783  0.2  0.2  2752 ?        Ssl  02:21   1:39 /usr/bin/vmtoolsd
root        784  0.0  0.1  1580 ?        Ss   02:21   0:00 /usr/bin/abrt-watch-log -F Backtrace /var/log/Xo
root        790  0.0  0.0  90568   888 ?        Ss   02:21   0:03 /sbin/rngd -f
chrony      799  0.0  0.1  1168 ?        S    02:21   0:00 /usr/sbin/chronyd
rpc         803  0.0  0.0  69256   428 ?        Ss   02:21   0:00 /sbin/rpcbind -w
root        814  0.0  0.8  8072 ?        Ssl  02:21   0:01 /usr/bin/python2 -Es /usr/sbin/firewalld --nofor
root        822  0.0  0.0   864 ?        S    02:21   0:01 /bin/bash /usr/sbin/ksmtuned
root        899  0.0  0.4  4532 ?        Ssl  02:21   0:01 /usr/sbin/NetworkManager --no-daemon
root       1151  0.0  0.1  1812 ?        Ss   02:21   0:00 /usr/sbin/cupsd -f
root       1152  0.0  0.1  1392 ?        Ss   02:21   0:00 /usr/sbin/sshd -D
root       1156  0.0  0.9  9492 ?        Ssl  02:21   0:10 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root       1162  0.0  0.3  3704 ?        Ssl  02:21   0:06 /usr/sbin/rsyslogd -n
root       1168  0.0  0.6 6708 ?        Ssl  02:21   0:01 /usr/sbin/libvirtd
root       1187  0.0  0.0  25908   552 ?        Ss   02:21   0:00 /usr/sbin/atd -f
root       1189  0.0  0.1  1216 ?        Ss   02:21   0:01 /usr/sbin/crond -n
root       1190  0.0  0.5  5160 ?        Ssl  02:21   0:00 /usr/sbin/gdm
root       1252  0.0  3.7 37412 tty1     Ssl+ 02:21   0:10 /usr/bin/X :0 -background none -noreset -audit 4
nobody     1408  0.0  0.0  53876   944 ?        S    02:21   0:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/d
root       1409  0.0  0.0  53848   384 ?        S    02:21   0:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/d
root       1464  0.0  0.1  91792  1900 ?        Ss   02:21   0:00 /usr/libexec/postfix/master -w
postfix    1483  0.0  0.1  91964  1932 ?        S    02:21   0:00 qmgr -l -t unix -u
root       1643  0.0  0.3  3296 ?        Ssl  02:21   0:00 /usr/libexec/upowerd
root       1707  0.0  0.3  2996 ?        Ssl  02:21   0:00 /usr/libexec/boltd
root       1713  0.0  0.1  78660  1676 ?        Ss   02:21   0:00 /usr/sbin/wpa_supplicant -u -f /var/log/wpa_supp
root       1715  0.0  0.8  8676 ?        Ssl  02:21   0:01 /usr/libexec/packagekitd
colord     1798  0.0  0.3  3840 ?        Ssl  02:21   0:00 /usr/libexec/colord
root       1867  0.0  0.4  4260 ?        Sl   02:22   0:00 gdm-session-worker [pam/gdm-password]
root       1880  0.0  0.2  2848 ?        Sl   02:22   0:00 /usr/bin/gnome-keyring-daemon --daemonize --logi
root       1886  0.0  0.5  5376 ?        Ssl  02:22   0:00 /usr/libexec/gnome-session-binary --session gnom
root       1895  0.0  0.0  59016   812 ?        S    02:22   0:00 dbus-launch --sh-syntax --exit-with-session
root       1896  0.0  0.2  69300  2420 ?        Ssl  02:22   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --prin
root       1923  0.0  0.4  4808 ?        Sl   02:22   0:00 /usr/libexec/imsettings-daemon
root       1927  0.0  0.2  2804 ?        Sl   02:22   0:00 /usr/libexec/gvfsd
root       1932  0.0  0.2  2156 ?        Sl   02:22   0:00 /usr/libexec/gvfsd-fuse /run/user/0/gvfs -f -o b
root       2013  0.0  0.0  72472   776 ?        Ss   02:22   0:00 /usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash 
root       2027  0.0  0.4  4632 ?        Sl   02:22   0:00 /usr/libexec/at-spi-bus-launcher
root       2032  0.0  0.1  68392  1856 ?        Sl   02:22   0:00 /usr/bin/dbus-daemon --config-file=/usr/share/de
root       2037  0.0  0.3  3076 ?        Sl   02:22   0:00 /usr/libexec/at-spi2-registryd --use-gnome-sessi
root       2064  0.1 15.7 ?      Sl   02:22   1:19 /usr/bin/gnome-shell
root       2080  0.0  0.4  4324 ?        Sl   02:22   0:01 ibus-daemon --xim --panel disable
root       2084  0.0  0.2  2580 ?        Sl   02:22   0:00 /usr/libexec/ibus-dconf
root       2088  0.0  0.7  7564 ?        Sl   02:22   0:00 /usr/libexec/ibus-x11 --kill-daemon
root       2092  0.0  0.2  2404 ?        Sl   02:22   0:00 /usr/libexec/ibus-portal
root       2100  0.0  0.2  2224 ?        Sl   02:22   0:00 /usr/libexec/xdg-permission-store
root       2104  0.0  0.7  7616 ?        Sl   02:22   0:00 /usr/libexec/gnome-shell-calendar-server
root       2113  0.0  0.6  6844 ?        Sl   02:22   0:00 /usr/libexec/evolution-source-registry
root       2121  0.0  0.6  6244 ?        Sl   02:22   0:00 /usr/libexec/mission-control-5
root       2126  0.0  0.3  3600 ?        Sl   02:22   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
root       2128  0.0  0.9  9072 ?        Sl   02:22   0:00 /usr/libexec/goa-daemon
root       2137  0.0  0.2  2824 ?        Sl   02:22   0:00 /usr/libexec/gvfs-afc-volume-monitor
root       2144  0.0  0.2  2800 ?        Sl   02:22   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
root       2149  0.0  0.2  2696 ?        Sl   02:22   0:00 /usr/libexec/gvfs-mtp-volume-monitor
root       2155  0.0  0.2  2460 ?        Sl   02:22   0:00 /usr/libexec/gvfs-goa-volume-monitor
root       2167  0.0  0.4  3992 ?        Sl   02:22   0:02 /usr/libexec/goa-identity-service
root       2174  0.0  0.8  8480 ?        Sl   02:22   0:00 /usr/libexec/gsd-power
root       2175  0.0  0.3  3568 ?        Sl   02:22   0:00 /usr/libexec/gsd-print-notifications
root       2178  0.0  0.2  2520 ?        Sl   02:22   0:00 /usr/libexec/gsd-rfkill
root       2181  0.0  0.2  2364 ?        Sl   02:22   0:00 /usr/libexec/gsd-screensaver-proxy
root       2186  0.0  0.3  3512 ?        Sl   02:22   0:00 /usr/libexec/gsd-sharing
root       2189  0.0  0.3  3060 ?        Sl   02:22   0:00 /usr/libexec/gsd-sound
root       2192  0.0  0.8  8208 ?        Sl   02:22   0:00 /usr/libexec/gsd-xsettings
root       2197  0.0  0.8  8184 ?        Sl   02:22   0:00 /usr/libexec/gsd-wacom
root       2200  0.0  0.2  2972 ?        Sl   02:22   0:00 /usr/libexec/gsd-smartcard
root       2202  0.0  0.2  2756 ?        Sl   02:22   0:00 /usr/libexec/gsd-account
root       2215  0.0  0.4  4588 ?        Sl   02:22   0:00 /usr/libexec/gsd-a11y-settings
root       2217  0.0  0.7  7516 ?        Sl   02:22   0:00 /usr/libexec/gsd-clipboard
root       2224  0.0  0.8  8408 ?        Sl   02:22   0:11 /usr/libexec/gsd-color
root       2226  0.0  0.4  4240 ?        Sl   02:22   0:00 /usr/libexec/gsd-datetime
root       2228  0.0  0.3  3056 ?        Sl   02:22   0:02 /usr/libexec/gsd-housekeeping
root       2229  0.0  0.4 4524 ?        S<l  02:22   0:04 /usr/bin/pulseaudio --start
root       2233  0.0  0.7  7568 ?        Sl   02:22   0:00 /usr/libexec/gsd-keyboard
root       2238  0.0  0.8 8184 ?        Sl   02:22   0:00 /usr/libexec/gsd-media-keys
root       2241  0.0  0.2  2492 ?        Sl   02:22   0:00 /usr/libexec/gsd-mouse
root       2274  0.0  0.0      0     0 ?        S<   02:22   0:00 [krfcommd]
root       2282  0.0  0.4  3992 ?        Sl   02:22   0:00 /usr/libexec/gsd-printer
geoclue    2293  0.0  0.3  3492 ?        Ssl  02:22   0:00 /usr/libexec/geoclue -t 5
root       2301  0.0  1.5 15652 ?       Sl   02:22   0:01 nautilus-desktop --force
root       2310  0.0  0.2  2900 ?        Sl   02:22   0:00 /usr/libexec/gvfsd-trash --spawner :1.4 /org/gtk
root       2317  0.0  0.8  8764 ?        Sl   02:22   0:00 /usr/libexec/evolution-calendar-factory
root       2324  0.1  1.0 10272 ?        Rl   02:22   1:29 /usr/bin/vmtoolsd -n vmusr
root       2325  0.0  0.2  2440 ?        Sl   02:22   0:00 /usr/libexec/gsd-disk-utility-notify
root       2330  0.0  0.4  4888 ?        S    02:22   0:00 /usr/bin/seapplet
root       2337  0.0  0.9  9164 ?        Sl   02:22   0:00 abrt-applet
root       2339  0.0  3.9 39244 ?       Sl   02:22   0:04 /usr/bin/gnome-software --gapplication-service
root       2340  0.0  1.1 10992 ?       Sl   02:22   0:00 /usr/libexec/evolution-calendar-factory-subproce
root       2346  0.0  0.9  9576 ?        SNl  02:22   0:00 /usr/libexec/tracker-extract
root       2350  0.0  0.5  5572 ?        SNl  02:22   0:00 /usr/libexec/tracker-miner-apps
root       2357  0.0  0.8  8016 ?        SNl  02:22   0:00 /usr/libexec/tracker-miner-fs
root       2360  0.0  0.7  7212 ?        SNl  02:22   0:00 /usr/libexec/tracker-miner-user-guides
root       2382  0.0  0.2  2284 ?        Sl   02:22   0:00 /usr/libexec/dconf-service
root       2388  0.0  1.0 10616 ?        Sl   02:22   0:00 /usr/libexec/tracker-store
root       2400  0.0  0.6  6644 ?        Sl   02:22   0:00 /usr/libexec/evolution-addressbook-factory
root       2427  0.0  1.1 11036 ?       Sl   02:22   0:00 /usr/libexec/evolution-addressbook-factory-subpr
root       2447  0.0  0.2  2752 ?        Sl   02:22   0:00 /usr/libexec/gvfsd-burn --spawner :1.4 /org/gtk/
root       2448  0.0  0.2  2592 ?        Sl   02:22   0:00 /usr/libexec/ibus-engine-simple
root       2482  0.0  0.4  4520 ?        Ssl  02:22   0:03 /usr/libexec/fwupd/fwupd
root       2662  0.0  0.2  2772 ?        Sl   02:28   0:00 /usr/libexec/gvfsd-metadata
root       3487  0.0  1.9 19676 ?        Sl   02:43   0:03 /usr/libexec/gnome-terminal-server
root       3493  0.0  0.0   8536   628 ?        S    02:43   0:00 gnome-pty-helper
root       3494  0.0  0.2  1992 pts/0    Ss+  02:43   0:00 bash
root       8273  0.0  0.0      0     0 ?        S<   10:17   0:00 [kworker/u257:0]
root       8274  0.0  0.0      0     0 ?        S<   10:17   0:00 [hci0]
root       8275  0.0  0.0      0     0 ?        S<   10:17   0:00 [hci0]
root       8277  0.0  0.0      0     0 ?        S<   10:17   0:00 [kworker/u257:2]
root      10719  0.0  0.5  5636 ?        Ss   13:51   0:03 sshd: root@pts/2
root      10723  0.0  0.3  3228 pts/2    Ss   13:51   0:01 -bash
postfix   11692  0.0  0.4  91896  4072 ?        S    15:01   0:00 pickup -l -t unix -u
root      11837  0.0  0.0      0     0 ?        S    15:12   0:01 [kworker/0:2]
root      11932  0.0  0.0      0     0 ?        S    15:20   0:00 [kworker/u256:1]
root      12020  0.0  0.0      0     0 ?        S    15:30   0:00 [kworker/u256:2]
root      12092  0.0  0.0      0     0 ?        S    15:37   0:00 [kworker/0:3]
root      12149  0.0  0.0      0     0 ?        R    15:42   0:00 [kworker/0:0]
root      12174  0.0  0.0   352 ?        S    15:44   0:00 sleep 60
root      12175  0.0  0.1  1872 pts/2    R+   15:44   0:00 ps aux

案例4:显示ssh进程的信息

[root@localhost home]# ps aux | grep "ssh"

案例5:显示系统进程的3~5行

方法一:[root@localhost home]# ps aux | head -n5 | tail -3

小讯
上一篇 2025-03-11 09:20
下一篇 2025-01-17 19:36

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/122602.html