..bits & bytes teleported

Monday Nov 10, 2008

Discovered a neat terminal emulator- Terminator while going through the OpenSolaris 2008.11 package manager.

Think about Draggable, Resizable, Horizontal and Vertically-splittable terminals.

Found its available on Linux, as well. Cool.

Saturday Oct 11, 2008

Bashish rocks your socks: http://bashish.sourceforge.net/

Linux prompt like Angelina Golie: http://www.thegeekstuff.com/2008/09/bash-shell-ps1-10-examples-to-make-your-linux-prompt-like-angelina-jolie/

Friday Aug 29, 2008

/proc (procfs) is a Virtual File System (VFS) on Unix systems. Here I am limiting myself to the Linux and Solaris flavors of Unix.

/proc on Linux

/proc on Linux contains the "live" information about the system. Process status, disk and network activity, and information related to memory, etc are all reflected via entries in the /proc.

A snapshot of /proc shows at any instant shows an arrangement of sub-directories and files:

dr-xr-xr-x  5 root     root            0 Aug 25 19:04 1
dr-xr-xr-x  5 root     root            0 Aug 25 19:04 10
dr-xr-xr-x  5 root     root            0 Aug 25 19:04 1018
dr-xr-xr-x  5 root     root            0 Aug 25 19:04 11
dr-xr-xr-x  5 root     root            0 Aug 25 19:04 12
dr-xr-xr-x  5 root     root            0 Aug 25 19:04 13
dr-xr-xr-x  5 nc219771 wheel           0 Aug 27 17:30 13223
dr-xr-xr-x  5 ns195518 wheel           0 Aug 28 17:24 13418
.
.
dr-xr-xr-x  6 root     root            0 Aug 26 00:34 bus
-r--r--r--  1 root     root            0 Aug 29 14:49 cmdline
-r--r--r--  1 root     root            0 Aug 29 14:49 cpuinfo
-r--r--r--  1 root     root            0 Aug 29 14:49 crypto
-r--r--r--  1 root     root            0 Aug 29 14:49 devices
-r--r--r--  1 root     root            0 Aug 29 14:49 diskstats
-r--r--r--  1 root     root            0 Aug 29 14:49 dma
dr-xr-xr-x  2 root     root            0 Aug 29 14:49 driver
-r--r--r--  1 root     root            0 Aug 29 14:49 execdomains
-r--r--r--  1 root     root            0 Aug 29 14:49 fb
-r--r--r--  1 root     root            0 Aug 29 14:49 filesystems

The entries in the first half of the above snapshot has information related to the current processes in the system arranged by their process ids (PID).

In the second half of the snapshot the sub-directories and files contain system-wide information about the system- CPU information, current filesystems, etc.

/proc on Solaris

/proc snapshot on a Solaris box shows a slightly different picture:

dr-x--x--x   5 root     root         832 Aug  4 03:42 0
dr-x--x--x   5 root     root         832 Aug  4 03:42 1
dr-x--x--x   5 daemon   daemon       832 Aug  4 03:46 112
dr-x--x--x   5 root     root         832 Aug  4 03:46 122
dr-x--x--x   5 root     root         832 Aug  4 03:46 125
dr-x--x--x   5 root     root         832 Aug  4 03:46 149
dr-x--x--x   5 root     root         832 Aug 27 14:32 15151
dr-x--x--x   5 as227057 staff        832 Aug 27 14:32 15158
dr-x--x--x   5 as227057 staff        832 Aug 27 14:32 15159
dr-x--x--x   5 as227057 staff        832 Aug 27 14:32 15209
dr-x--x--x   5 root     root         832 Aug  4 03:42 2

As is apparent, only the run-time information related to the running processes is mentioned in the /proc.

Compared to this, the /proc on Linux seems to be more of a dumping ground for all the live information of the system.

/usr/proc/bin

In addition to /proc Solaris also contains a directory /usr/proc under which lives the 'bin' subdirectory which has some tools to work with processes:

lrwxrwxrwx   1 root     root          15 Aug  4 01:50 pcred -> ../../bin/pcred
lrwxrwxrwx   1 root     root          16 Aug  4 01:50 pfiles -> ../../bin/pfiles
lrwxrwxrwx   1 root     root          16 Aug  4 01:50 pflags -> ../../bin/pflags
lrwxrwxrwx   1 root     root          14 Aug  4 01:50 pldd -> ../../bin/pldd
lrwxrwxrwx   1 root     root          14 Aug  4 01:50 pmap -> ../../bin/pmap
lrwxrwxrwx   1 root     root          14 Aug  4 01:50 prun -> ../../bin/prun
lrwxrwxrwx   1 root     root          14 Aug  4 01:50 psig -> ../../bin/psig
lrwxrwxrwx   1 root     root          16 Aug  4 01:50 pstack -> ../../bin/pstack
lrwxrwxrwx   1 root     root          15 Aug  4 01:50 pstop -> ../../bin/pstop
lrwxrwxrwx   1 root     root          15 Aug  4 01:50 ptime -> ../../bin/ptime
lrwxrwxrwx   1 root     root          15 Aug  4 01:50 ptree -> ../../bin/ptree
lrwxrwxrwx   1 root     root          15 Aug  4 01:50 pwait -> ../../bin/pwait
lrwxrwxrwx   1 root     root          14 Aug  4 01:50 pwdx -> ../../bin/pwdx

Resources: