UNIX For Dummies [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

UNIX For Dummies [Electronic resources] - نسخه متنی

John Levine, Margaret Levine Young

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید

Finding Out Who’s on Your Computer

You can use three main commands to find out who’s using your machine:

who , w , and finger . The simple way to use either one is just to type who.

The typical response is something like this:

johnl console Sep 3 14:57
johnl ttyp1 Sep 3 14:57 (:0.0)
johnl ttyp2 Sep 3 14:57 (:0.0)
johnl ttyp3 Sep 4 17:48 (:0.0)
johnl ttyp4 Sep 18 10:48 (:0.0)
johnl ttyp5 Sep 26 18:42 (:0.0)
johnl ttyp7 Sep 9 14:10 (:0.0)
You see the user, terminal, and login time. User johnl logged in seven times because he has a bunch of X terminal windows, each of which counts as a login session. Although the exact output from who varies from one version of UNIX to another, it always contains at least this much. You can also type who am i , and UNIX prints just the line for the terminal (or terminal window) in which you typed the command. (A similar UNIX command, whoami , prints only the name of the user logged in at the prompt where you typed the command.)
A considerably more informative program is finger because it produces a more useful report than who does:

Login Name Tty Idle Login Time Office Phone
johnl John R Levine co 23d Sep 3 14:57 NY 387
johnl John R Levine p1 6:10 Sep 3 14:57 NY 387
johnl John R Levine p2 1d Sep 3 14:57 NY 387
johnl John R Levine p3 22d Sep 4 17:48 NY 387
johnl John R Levine p4 1:53 Sep 18 10:48 NY 387
johnl John R Levine *p5 Sep 26 18:42 NY 387
johnl John R Levine p7 1:14 Sep 9 14:10 NY 387
Although finger reports the same stuff as who does, it also looks up the user’s real name (if it’s in the user password file) and tells you how long the terminal has been idle (how long it has been since the user last typed something). If the system administrator entered the information, finger also usually shows an office phone number, room number, or other handy info about where the user works.

You can also use finger to ask about a specific user, and UNIX looks up some extra info about that user. In this example, we used it to look up one of the authors of this book:

finger johnl

UNIX returned this information:

Login: johnl Name: John R Levine
Directory: /home/johnl Shell: /bin/bash
Office: Trumansburg, 607 387 6874
On since Wed Sep 3 14:57 (EDT) on console, idle 23 days 10:34
Last login Sat Sep 27 01:31 (EDT) on ttyp0 from bebel.iecc.com
Project: Working on "UNIX for Dummies, 5th Ed."
Plan:
Write many books, become famous.

The Project and Plan lines are merely the contents of files called .project and .plan in the login directory. (Yes, the filenames start with periods.) It has become customary to put a clever remark in your .plan file, but please don’t overdo it. If the user is logged in on more than one terminal or terminal window, finger gives a full report for each terminal. The finger johnl command we gave reported all the logins — but we edited it to save paper.
The w command provides yet another version of the same info:

1:24AM up 23 days, 9:50, 7 users, load averages: 2.16, 1.72, 1.44
USER TTY FROM LOGIN@ IDLE WHAT
johnl co - 03Sep03 23days xinit /home/johnl/.xinitrc
johnl p1 :0.0 03Sep03 6:06 tail -f current
johnl p2 :0.0 03Sep03 27:34 -bash (bash)
johnl p3 :0.0 04Sep03 22days ./dnetc
johnl p4 :0.0 18Sep03 1:49 -bash (bash)
johnl p5 :0.0 Fri06PM 1:13 (pine)
johnl p7 :0.0 09Sep03 1:10 -bash (bash)

/ 213