04 tty, uname, issue, id, lsof, cksum, md5sum, id

Want to know what virtual terminal, or pseudo-terminal, you're in?
In the console:
$ tty
/dev/tty

In an x terminal:
$ tty
/dev/pts/3

Which kernel am I running?
$ uname -a
Linux windbag 2.4.21 #1 Sun Aug 3 20:15:59 PDT 2003 i686 GNU/Linux

Show the CRC checksum and byte count of a file, this is useful for seeing if a
file has been altered:

$ cksum file.txt
3308026366 7384 file.txt

Obviously you'll need an original checksum to compare!

md5sum is better if you need to verify a remote file, because it is hashed and
encrypted. To calculate the md5sum of a file:

$ md5sum filename
60ca4fa286cb45aafbfd01e0f052c5c3 filename

Then compare it with the published MD5 hash for the file. Let's you download
the typical 3 mondo .isos of a Linux distribution, to burn to 3 CDs. Copy the
three md5sums into a file, with the filenames, into a file, and call it
checksums.txt:

76ef22495d186580e47efd8d7a65fe6b yarrow-i386-disc1.iso
fd23fe32fafe7557f5d1fa1d31100580 yarrow-i386-disc2.iso
6a26b34069639d0c31465d4079a8e1b2 yarrow-i386-disc3.iso

Put this in the same directory as the .isos, then run

$ md5sum -cv checksums.txt
yarrow-i386-disc1.iso OK
yarrow-i386-disc2.iso OK
yarrow-i386-disc3.iso OK

Generating your own md5sum is ever so easy:

$ md5sum filename
44d305fdb74dd643c8d4f760024e9fee filename

Where does the information that is displayed on login console come from? This
needs a fixed font, like Courier, to look right:

$ cat /etc/issue
_ _ _ _
| | (_) |__ _ __ __ _ _ __ ___| |_
| | | | '_ \| '__/ _` | '_ \ / _ \ __|
| |___| | |_) | | | (_| | | | | __/ |_
|_____|_|_.__/|_| \__,_|_| |_|\___|\__|

Libranet GNU/Linux 2.8.1 \m \n \l

Where do you find out what \m \n \l mean?
issue (5)
getty (8)

What is my guid, uid, and what groups do I belong to?

$ id
uid=1000(carla) gid=1000(carla) groups=1000(carla),20(dialout),24(cdrom),25
(floppy),29(audio),30(dip),44(video),105(windows),432(usb),1001
(cdrecording),1008(share)


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Great boat for sale! 16' Smokercraft Osprey!
Trailer, live well, fish finder, stuff!
http://www.tuxcomputing.com/boat

Carla Schroder
this message brought to you
by Libranet 2.8 and Kmail
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~