Showing posts with label runlevel. Show all posts
Showing posts with label runlevel. Show all posts

Monday, October 17, 2011

How to find current runlevel on unix with who

คำสั่ง who เป็นคำสั่งเอาไว้แสดงว่าตอนนี้มีใคร log in อยู่ในระบบบ้าง โดยเมื่อใช้คำสั่ง
who
จะแสดงผลประมาณนี้
yut  tty7         2011-10-17 08:55 (:0)
yut  pts/1        2011-10-17 08:55 (:0)
ในขณะที่คำสั่งสำหรับดู previous and current runlevel ก็คือคำสั่ง runlevel
runlevel
N 2
แต่สำหรับคำสั่ง who นั้นสามารถดู current runlevel ได้ด้วยคำสั่ง
who -r
         run-level 2  2011-10-17 08:54
โดยถ้าหากต้องการดูทั้ง current runlevel และ ดูว่ามีใคร log in ในระบบด้วย จะใช้คำสั่ง
who -a
           system boot  2011-10-17 08:54
           run-level 2  2011-10-17 08:54
LOGIN      tty4         2011-10-17 08:54              1008 id=4
LOGIN      tty5         2011-10-17 08:54              1014 id=5
LOGIN      tty2         2011-10-17 08:54              1034 id=2
LOGIN      tty3         2011-10-17 08:54              1036 id=3
LOGIN      tty6         2011-10-17 08:54              1042 id=6
LOGIN      tty1         2011-10-17 08:54              1637 id=1
yut        + tty7         2011-10-17 08:55  old         2043 (:0)
yut       + pts/1        2011-10-17 08:55 01:03        2133 (:0)

ที่มา www.theunixtips.com

Read More