blockdev命令blkid命令badblocks命令fdisk命令du命令df命令convertquota命令lvcreate命令lsblk命令lilo命令hdparm命令grub命令lvremove命令lvreduce命令lvextend命令lvdisplay命令mkisofs命令mkinitrd命令mkbootdisk命令lvscan命令lvresize命令pvchange命令partprobe命令parted命令mkswap命令mknod命令pvs命令pvremove命令pvdisplay命令pvcreate命令pvck命令vgcreate命令vgconvert命令vgchange命令pvscan命令vgremove命令vgreduce命令vgextend命令vgdisplay命令fuser命令free命令dstat命令vgscan命令iotop命令iostat命令inotifywait命令ifstat命令nethogs命令mpstat命令ltrace命令lsof命令tload命令time命令strace命令sar命令arch命令vmstat命令uptime命令top命令losetup命令hwclock命令dmidecode命令cdrecord命令volname命令systool命令setpci命令lsusb命令lspci命令dmesg命令depmod命令bmodinfo命令lsmod命令kexec命令kernelversion命令insmod命令sysctl命令slabtop命令rmmod命令modprobe命令rcp命令ncftp命令ftp命令uname命令dump命令cpio命令tftp命令scp命令bunzip2命令arj命令restore命令bzip2命令bzgrep命令bzdiff命令bzcmp命令bzcat命令compress命令bzmore命令bzless命令bzip2recover命令tar命令lha命令gzip命令gzexe命令gunzip命令zcat命令unzip命令uncompress命令unarj命令znew命令zipsplit命令zipinfo命令zip命令zfore命令csplit命令comm命令colrm命令col命令fgrep命令expand命令egrep命令diffstat命令ispell命令grep命令fold命令fmt命令printf命令pr命令paste命令look命令join命令tac命令split命令spell命令sort命令rev命令uniq命令unexpand命令tr命令tee命令chgrp命令chattr命令wc命令lsattr命令file命令dos2unix命令chown命令chmod命令umask命令stat命令setfacl命令joe命令jed命令ex命令emacs命令ed命令vi命令sed命令pico命令nano命令hexdump命令head命令cut命令tail命令od命令more命令less命令find命令diff3命令diff命令cmp命令which命令whereis命令strings命令iconv命令dirname命令dd命令cat命令basename命令rename命令pathchk命令nl命令ln命令cd命令updatedb命令unlink命令touch命令ls命令install命令dirs命令cp命令pushd命令popd命令mv命令mkdir命令tree命令rmdir命令rm命令pwd命令gcov命令gcc命令expr命令as命令ldd命令ldconfig命令ld命令indent命令gdb命令objdump命令nm命令mktemp命令make命令readelf命令pstack命令protoize命令php命令perl命令apt-key命令apt-get命令unprotoize命令test命令chkconfig命令aptitude命令apt-sortpkgs命令dpkg-deb命令dpkg命令dnf命令dpkg-reconfigure命令dpkg-query命令dpkg-preconfigur命令dpkg-divert命令ntsysv命令dpkg-trigger命令dpkg-statoverrid命令dpkg-split命令rpm2cpio命令rpm命令rcconf命令patch命令rpmverify命令rpmsign命令rpmquery命令rpmdb命令rpmbuild命令cupsdisable命令cancel命令accept命令yum命令lpadmin命令lp命令eject命令cupsenable命令lpstat命令lprm命令lpr命令lpq命令lpc命令dnsdomainname命令dhclient命令reject命令ifcfg命令hostname命令ethtool命令domainname命令mii-tool命令ifup命令ifdown命令ifconfig命令ypdomainname命令usernetctl命令route命令nisdomainname命令ssh命令sftp-server命令sftp命令nmap命令iptstate命令ssh-keygen命令ssh-copy-id命令ssh-agent命令ssh-add命令arping命令arp命令sshd命令ssh-keyscan命令iperf命令hping3命令host命令dig命令arpwatch命令tracepath命令ping命令nslookup命令netstat命令elinks命令curl命令axel命令traceroute命令lftp命令jwhois命令ipcalc命令elm命令mailstat命令mailq命令mail命令lynx命令lftpget命令rsh命令rlogin命令rexec命令telnet命令apachectl命令ab命令wget命令ftptop命令ftpshut命令ftpcount命令exportfs命令mysqladmin命令mysql命令htpasswd命令htdigest命令ftpwho命令nfsstat命令mysqlshow命令mysqlimport命令mysqldump命令squid命令smbpasswd命令smbclient命令showmount命令sendmail命令ip命令arptables命令arpd命令squidclient命令iptables命令ip6tables-save命令ip6tables-restor命令ip6tables命令pfctl命令lnstat命令iptraf命令iptables-save命令iptables-restore命令tcpreplay命令tcpdump命令ss命令shutdown命令reboot命令poweroff命令halt命令ctrlaltdel命令restorecon命令getsebool命令chcon命令setsebool命令sesearch命令semanage命令seinfo命令xhost命令xclip命令xauth命令startx命令xlsfonts命令xlsclients命令xlsatoms命令xinit命令chpasswd命令chfn命令chage命令xset命令groupadd命令gpasswd命令finger命令chsh命令grpconv命令grpck命令groups命令groupmod命令groupdel命令newusers命令logname命令id命令grpunconv命令pwconv命令pwck命令passwd命令nologin命令userdel命令useradd命令su命令pwunconv命令atq命令at命令usermod命令ipcrm命令init命令crontab命令batch命令atrm命令nohup命令nice命令killall命令ipcs命令pkill命令pidof命令pgrep命令renice命令pstree命令ps命令pmap命令telint命令systemctl命令skill命令service命令runlevel命令alias命令watch命令w命令builtin命令bind命令bg命令apropos命令echo命令dris命令declare命令command命令export命令exit命令exec命令env命令enable命令history命令help命令fg命令fc命令read命令logout命令let命令kill命令jobs命令shopt命令sh命令set命令seq命令readonly命令ulimit命令type命令trap命令tput命令wait命令unset命令unalias命令cksum命令cal命令bc命令awk命令clear命令date命令consoletype命令clockdiff命令gpm命令dircolors命令hostid命令login命令info命令mesg命令md5sum命令man命令ngrep命令mtools命令ntpdate命令rsync命令pssh命令screen命令sum命令stty命令speedtest-cli命令sleep命令vdfuse命令users命令tempfile命令talk命令whoami命令who命令whatis命令wall命令dumpe2fs命令yes命令xargs命令write命令edquota命令e2label命令e2image命令e2fsck命令mkfs命令mke2fs命令fsck命令findfs命令quotaoff命令quotacheck命令quota命令mountpoint命令mount命令resize2fs命令repquota命令quotastats命令quotaon命令tune2fs命令sync命令swapon命令swapoff命令umount命令

pstack命令

pstack命令显示每个进程的栈跟踪。pstack 命令必须由相应进程的属主或 root 运行。可以使用 pstack 来确定进程挂起的位置。此命令允许使用的唯一选项是要检查的进程的 PID

命令软件包下载地址:https://packages.debian.org/sid/pstack

实例

pstree以树结构显示进程

pstree -p work | grep ad
sshd(22669)---bash(22670)---ad_preprocess(4551)-+-{ad_preprocess}(4552)
                                                |-{ad_preprocess}(4553)
                                                |-{ad_preprocess}(4554)
                                                |-{ad_preprocess}(4555)
                                                |-{ad_preprocess}(4556)
                                                `-{ad_preprocess}(4557)

work为工作用户,-p为显示进程识别码,ad_preprocess共启动了6个子线程,加上主线程共7个线程。

ps -Lf 4551
UID        PID  PPID   LWP  C NLWP STIME TTY      stat   time CMD
work      4551 22670  4551  2    7 16:30 pts/2    Sl+    0:02 ./ad_preprocess
work      4551 22670  4552  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4553  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4554  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4555  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4556  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4557  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess

进程共启动了7个线程

pstack显示每个进程的栈跟踪:

pstack 4551
Thread 7 (Thread 1084229984 (LWP 4552)):
#0  0x000000302afc63dc in epoll_wait () from /lib64/tls/libc.so.6
#1  0x00000000006f0730 in ub::EPollEx::poll ()
#2  0x00000000006f172a in ub::NetReactor::callback ()
#3  0x00000000006fbbbb in ub::UBTask::CALLBACK ()
#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#6  0x0000000000000000 in ?? ()
Thread 6 (Thread 1094719840 (LWP 4553)):
#0  0x000000302afc63dc in epoll_wait () from /lib64/tls/libc.so.6
#1  0x00000000006f0730 in ub::EPollEx::poll ()
#2  0x00000000006f172a in ub::NetReactor::callback ()
#3  0x00000000006fbbbb in ub::UBTask::CALLBACK ()
#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#6  0x0000000000000000 in ?? ()
Thread 5 (Thread 1105209696 (LWP 4554)):
#0  0x000000302b80baa5 in __nanosleep_nocancel ()
#1  0x000000000079e758 in comcm::ms_sleep ()
#2  0x00000000006c8581 in ub::UbClientManager::healthyCheck ()
#3  0x00000000006c8471 in ub::UbClientManager::start_healthy_check ()
#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#6  0x0000000000000000 in ?? ()
Thread 4 (Thread 1115699552 (LWP 4555)):
#0  0x000000302b80baa5 in __nanosleep_nocancel ()
#1  0x0000000000482b0e in armor::armor_check_thread ()
#2  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#3  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#4  0x0000000000000000 in ?? ()
Thread 3 (Thread 1126189408 (LWP 4556)):
#0  0x000000302af8f1a5 in __nanosleep_nocancel () from /lib64/tls/libc.so.6
#1  0x000000302af8f010 in sleep () from /lib64/tls/libc.so.6
#2  0x000000000044c972 in Business_config_manager::run ()
#3  0x0000000000457b83 in Thread::run_thread ()
#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#6  0x0000000000000000 in ?? ()
Thread 2 (Thread 1136679264 (LWP 4557)):
#0  0x000000302af8f1a5 in __nanosleep_nocancel () from /lib64/tls/libc.so.6
#1  0x000000302af8f010 in sleep () from /lib64/tls/libc.so.6
#2  0x00000000004524bb in Process_thread::sleep_period ()
#3  0x0000000000452641 in Process_thread::run ()
#4  0x0000000000457b83 in Thread::run_thread ()
#5  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#6  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#7  0x0000000000000000 in ?? ()
Thread 1 (Thread 182894129792 (LWP 4551)):
#0  0x000000302af8f1a5 in __nanosleep_nocancel () from /lib64/tls/libc.so.6
#1  0x000000302af8f010 in sleep () from /lib64/tls/libc.so.6
#2  0x0000000000420d79 in Ad_preprocess::run ()
#3  0x0000000000450ad0 in main ()