In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Linux file system
Common Linux directory names:
The root of the directory usage / virtual directory. Usually, files / bin binary directories are not stored here, many user-level GUN tools / boot startup directories and startup files / dev device directories are stored, and Linux creates device nodes / etc system configuration files / home home directories here, Linux creates user directories / lib library directories, library files / media media directories for systems and applications, and common mount points / mnt mount directories for removable media devices Another common mount point / opt optional directory for removable media devices, which is often used to store third-party software packages and data files / proc process directories, to store existing hardware and current process information / rootroot users' home directory / sbin system binary directory, to store many GUN administrator level tools / run run directories, and to store runtime data / srv service directories when the system is running Store local service related files / sys system directory, system hardware information related files / tmp temporary directory, you can create and delete temporary working files / usr user binary directory, a large number of user-level GUN tools and data files are stored here / var variable directory, used to store frequently changing files, such as log files
Common directory names are based on file system level standards (filesystem hierarchy stanard, FHS). FHS is updated occasionally, and some Linux distributors may be using the old FHS standard. The latest FHS standard can be accessed from its official home page:
Http://www.pathname.com/fhs
Ps command to view the process
When a program runs on a system, it is called a process. To monitor these processes, you need to be familiar with the use of ps commands.
By default, the ps command displays only processes belonging to the current user that are running under the current console:
$ps PID TTY TIME CMD 4763 pts/0 00:00:00 bash 4782 pts/0 00:00:00 ps$
Here, the current user is only running bash shell (note that shell is just another process running on the system), as well as the ps command itself.
The GNU ps command used in the Linux system supports three different types of command line arguments:
Unix style parameters, with single dash line BSD style parameters in front, no dash line GNU style long parameters in front, and double dash line Unix style parameters in front.
The Unix-style parameters are inherited from the original ps commands on the AT&T Unix system developed by Bell Labs.
Unix-style ps command parameters:
Parameter description-A shows all processes-N shows all processes that do not match the indicated parameters-a shows all processes except control processes (session leader) and non-terminal processes-d shows all processes except control processes-e shows all processes. Should be the same as-A-C cmdlist shows the processes contained in the cmdlist list-G grplist shows the group ID's processes in the grplist list-U userlist shows the processes of the owner's user ID in the userlist list-g grplist shows the sessions or group ID's processes in the grplist list-p pidlist shows the processes of PID in the pidlist list-s sesslist shows the processes of the session ID in the sesslist list-t ttylist shows the terminal ID in the ttylist list Process-u userlist shows processes of valid user ID in userlist list-F shows more additional output (relative to the-f parameter)-O format displays default output columns and specific columns specified in the format list-M displays security information for processes-c displays additional scheduler information for processes-f displays output in full format-j displays task information-l displays a long list-o format only shows the The column specified by format-y do not show the process flag (process flag Table name process status tag)-Z displays security label (security context of SELinux) information-H displays the process in a hierarchical format (tree to show the parent process)-n namelist defines the value displayed by the WCHAN column-w in wide output mode, unlimited width display-L displays threads in the process-V displays the version number of the ps command
The command parameters are listed many, but not necessarily all. The key to using the ps command is not to remember how many parameters are available. Instead, just remember some of the most useful parameter combinations.
Ps-ef
View all processes running on the system:
$ps-efUID PID PPID C STIME TTY TIME CMDroot 1 00 18:23? 00:00:01 / usr/lib/systemd/systemd-- switched-root-- system-- deserialize 22root 2 00 18:23? 00:00:00 [kthreadd] root 3 20 18:23? 00:00:00 [ksoftirqd/0] root 5 2 0 18:23? 00:00:00 [kworker/0:0H] root 6 2 0 18:23? 00:00:00 [kworker/u2:0] root 7 2 0 18:23? 00:00:00 [migration/0] root 8 2 0 18:23? 00:00:00 [rcu_bh] root 9 2 0 18 23? 00:00:00 [rcu_sched] root 10 20 18:23? 00:00:00 [lru-add-drain]. Root 4250 10 18:23? 00:00:00 / usr/sbin/hypervkvpd-nroot 4251 10 18:23? 00:00:00 / usr/sbin/sshd-Droot 4253 18:23? 00:00:01 / usr/bin/python2-Es / usr/sbin/tuned-l-Proot 4254 10 18:23? 00:00:00 / usr/sbin/rsyslogd-nroot 4515 10 18:23? 00:00:00 / usr/libexec/postfix/master-wpostfix 4532 4515 0 18:24? 00:00:00 qmgr-l-t unix-uroot 4569 4251 0 18:24? 00:00:00 sshd: root@pts/0root 4763 4569 0 18:24 pts/0 00:00:00-bashpostfix 4931 4515 0 20:04? 00:00:00 pickup-l-t unix-uroot 4938 20 20:31? 00:00:00 [kworker/0:3] root 4944 20 20:46? 00:00:00 [kworker/0:2] root 4947 20 20:51? 00:00:00 [kworker/0:0] root 4949 4763 0 20:53 pts/0 00:00:00 ps-ef$
The information for each column describes:
UID: the user who started these processes PID: the process of the process IDPPID: the process number of the parent process (if the process is started by another process) C: CPU utilization in the life cycle of the process STIME: system time when the process starts TTY: terminal device when the process starts TIME: cumulative CPU time required to run the process CMD: name of the program started
Ps-el
Ps-ef is the most commonly used, while the-l parameter can display other additional information, or ps-efl can display both parts of the information.
Using the-l parameter produces a long format output:
$ps-elF S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD4 S 01 00 800-32005 ep_pol? 00:00:01 systemd1 S 0 200 800-0 kthrea? 00:00:00 kthreadd1 S 0 320 800-0 smpboo? 00:00:00 ksoftirqd/01 S 0 5 20 60-20-0 worker? 00:00:00 kworker/0:0H1 S 0 6 20 800-0 worker? 00:00:00 kworker/u2:01 S 0 7 20-40-0 smpboo? 00:00:00 migration/01 S 0 8 20 800-0 rcu_gp? 00:00:00 rcu_bh1 R 0 9 20 800-0-00:00:00 rcu_sched1 S 0 10 20 60-20-0 rescue? 00:00:00 lru-add-drain.4 S 0 4250 10 800-10025 poll_s? 00:00:00 hypervkvpd4 S 0 4251 10 800-28215 poll_s? 00:00:00 sshd4 S 0 4253 10 800-143481 poll_s? 00:00:02 tuned4 S 0 4254 10 800-55687 poll_s? 00:00:00 rsyslogd5 S 0 4515 10 800-22412 ep_pol? 00:00:00 master4 S 89 4532 45150 800-22455 ep_pol? 00:00:00 qmgr4 S 0 4569 4251 0 800-39183 poll_s? 00:00:00 sshd4 S 0 4763 4569 0 800-28859 do_wai pts/0 00:00:00 bash4 S 89 4931 4515 0 800-22438 ep_pol? 00:00:00 pickup1 S 04972 20 0800-0 worker? 00:00:00 kworker/0:01 S 0 4973 20 800-0 worker? 00:00:00 kworker/0:31 S 0 4974 20 800-0 worker? 00:00:00 kworker/0:11 R 0 4977 20 800-0 -? 00:00:00 kworker/0:20 R 0 4979 4763 0 800-38309-pts/0 00:00:00 ps$ ^
The information for each column describes:
F: the kernel assigns the system flag S to the process S: the state of the process is running, S is dormant, R is runnable, Z is waiting to run, the process is finished, but the parent process no longer exists T stands for stopping PRI: priority of the process (higher indicates lower priority) NI: modesty value is used to determine priority ADDR: memory address of the process SZ: if the process is swapped out Approximate size of swap space required WCHAN: the address of the kernel function in which the process sleeps, BSD-style argument
The Berkeley software distribution (Berkeley software distribution, BSD) is a Unix version developed by the University of California, Berkeley.
BSD-style ps command parameters:
Parameter description T displays all processes associated with the current terminal a displays all processes associated with any terminal g displays all processes, including control process r displays only running processes x shows all processes Even processes that do not assign any terminals U userlist display processes owned by a user ID in the userlist list p pidlist display PID processes in the pidlist list t ttylist displays the associated terminal processes in the ttylist list O format in addition to the default output column X specified by format adds security information to the output in the past Linux i386 register format display Z. The effect and-Z parameters are similar j display task information l display task information in long mode o format only the columns specified by format s display in signal format u display in user-based format v display in virtual memory format N namelist defines values used in WCHAN columns O order defines the order of display information columns S adds numerical information from the child process to the parent process For example, CPU and memory usage c displays the real command name (the program name used to start the process) e shows the environment variable used by the command f to display the process in a hierarchical format, indicating which processes are started and which processes h do not display header information k sort specifies to display the output sorted column n together with the WCHAN information Use numeric values to represent user ID and group IDw for wider screen display wide output H will thread by process display m display thread L list all format specifiers V display version number of ps command after the process
Many of the parameters of the Unix and BSD types are duplicated, and in most cases, you can choose parameters in the format you reuse.
Ps aux
This is a BSD-style command that displays all processes. The effect is similar to ps-ef, mainly because the display style is different and the output columns are also different.
When using the BSD parameter, the ps command automatically changes the output to mimic the BSD format:
Ps auxUSER PID% CPU% MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.0 0.3 128000 6540? Ss 09:19 0:01 / usr/lib/systemd/systemd-- switched-root-- system-- deserialize 22root 2000? S 09:19 0:00 [kthreadd] root 3 0.0 0.0 00? S 09:19 0:00 [ksoftirqd/0] root 5 0.0 0.0 00? S < 09:19 0:00 [kworker/0:0H] root 6 0.000? S 09:19 0:00 [kworker/u2:0] root 7 0.0 0.0 00? S 09:19 0:00 [migration/0] root 8 0.0 0.0 00? S 09:19 0:00 [rcu_bh] root 9 0.0 0.0 00? R 09:19 0:00 [rcu_sched] root 10 0.0 0.0 00? S < 09:19 0:00 [lru-add-drain]. Root 4256 0.0 40100 1540? Ss 09:19 0:00 / usr/sbin/hypervkvpd-nroot 4258 0.00.2 112860 4296? Ss 09:19 0:00 / usr/sbin/sshd-Droot 4259 0.00.4 222748 7800? Ssl 09:19 0:00 / usr/sbin/rsyslogd-nroot 4261 0.00.9 573924 17144? Ssl 09:19 0:00 / usr/bin/python2-Es / usr/sbin/tuned-l-Proot 4503 0.00.1 89648 2100? Ss 09:19 0:00 / usr/libexec/postfix/master-wpostfix 4516 0.00.2 89752 4068? S 09:19 0:00 pickup-l-t unix-upostfix 4517 0.00.2 89820 4096? S 09:19 0:00 qmgr-l-t unix-uroot 4770 0.00.3 156732 5524? Ss 09:28 0:00 sshd: root@pts/0root 4774 0.00.1 115436 2068 pts/0 Ss 09:28 0:00-bashroot 4829 0.000? S 09:35 0:00 [kworker/0:3] root 4887 0.0 0.0 00? S 09:40 0:00 [kworker/0:1] root 4901 0.0 0.0 00? R 09:45 0:00 [kworker/0:0] root 4903 0.00.1 155360 1884 pts/0 R + 09:48 0:00 ps aux$
The information for each column describes:
VSZ: the size of a process in memory, in kilobytes (KB) RSS: the physical memory occupied by a process when not called out STAT: a two-character status code that represents the current state of the process.
The process status code represented in BSD style is more detailed. The double character code can represent the current state of the process more clearly than the single character status code output in Unix style.
The first character takes the same value as the Unix cell S column, indicating hibernation (S), run (O), or wait (R).
The second value further illustrates the status of the process:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.