Kristofer Younger 8 lat temu
rodzic
commit
2a337cb18b
1 zmienionych plików z 23 dodań i 1 usunięć
  1. 23
    1
      Bash.md

+ 23
- 1
Bash.md Wyświetl plik

@@ -168,4 +168,26 @@ $ du -h -s *
168 168
 1.1M	vonnuemann-edvac.pdf
169 169
   0B	zipcity.php?inputstring=19707
170 170
 ```
171
-which shows how much space each item in a home directory is taking on the disk.
171
+which shows how much space each item in a home directory is taking on the disk.
172
+
173
+### w
174
+Yes, `w`. Display who is logged in to this computer and what they are doing.
175
+
176
+The w utility prints a summary of the current activity on the system, including what each user is doing.  The first line displays the current time of day, how long the system has been running, the number of users logged into the system, and the load averages.  The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes.
177
+
178
+The fields output are the user's login name, the name of the terminal the user is on, the host from which the user is logged in, the time the user logged on, the time since the user last typed anything, and the name and arguments of the current process.
179
+
180
+Usually, when I first get into a new computer, `w` helps me get a feel for what's going on.
181
+
182
+### ps
183
+The ps utility displays a header line, followed by lines containing information about all of your processes that have controlling terminals.
184
+
185
+A different set of processes can be selected for display by using any combination of the -a, -G, -g, -p, -T, -t, -U, and -u options.  If more than one of these options are
186
+     given, then ps will select all processes which are matched by at least one of the given options.
187
+
188
+     For the processes which have been selected for display, ps will usually display one line per process.  The -M option may result in multiple output lines (one line per thread)
189
+     for some processes.  By default all of these output lines are sorted first by controlling terminal, then by process ID.  The -m, -r, and -v options will change the sort order.
190
+     If more than one sorting option was given, then the selected processes will be sorted by the last sorting option which was specified.
191
+
192
+     For the processes which have been selected for display, the information to display is selected based on a set of keywords (see the -L, -O, and -o options).  The default output
193
+     format includes, for each process, the process' ID, controlling terminal, CPU time (including both user and system time), state, and associated command.