هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
w combines uptime and who, and adds the current program of each session. The first line shows the time, how long the system is up, the number of users and the load average (1, 5 and 15 minutes).
Columns: USER, TTY, FROM (remote address), LOGIN@ (login time), IDLE, JCPU (CPU of all processes of the terminal), PCPU (CPU of the current process) and WHAT (the current command).
طريقة الكتابة
w [OPTIONS] [USER]الخيارات 10
الأكثر استخدامًا
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 11
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Who does what?
w 09:12:01 up 1:14, 2 users, load average: 0.08, 0.12, 0.10 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT student tty2 tty2 08:10 1:02m 0.05s 0.03s /usr/libexec/gnome-session-binary admin pts/0 192.168.122.1 09:02 0.00s 0.04s 0.00s wLoad average under the number of CPUs is normal.
2Only one user
w adminSessions and current commands of admin.
3Without the header, for a script
w -hOne line per session.
4Short form
w -sFewer columns, easier to read on a small screen.
5IP addresses instead of names
w -iUseful when reverse DNS is slow or wrong.
6Show the process IDs of the current commands
w -pThen you can look at a process with
ps -fp PIDor stop it.7Find who runs a heavy command
Sort on JCPU to see the busy sessions.
8Check the load before a big job
w | head -1If the load is high, start the backup later.
9Find idle sessions to clean up
w -h | awk '$4 ~ /days/'Sessions idle for days. Ask the users or end them with
pkill -t pts/N.10Spot a suspicious session (security)
w -i | grep -v '192.168.122.'A login from an unknown network with a strange WHAT command needs attention.
11Compare with uptime
The first line of w is the uptime output.
لا يوجد شيء يطابق هذا الفلتر.
نصائح للحفظ
- w = uptime + who + what. Look at load average and WHAT.