• Shortcuts : 'n' next unread feed - 'p' previous unread feed • Styles : 1 2

» Publishers, Monetize your RSS feeds with FeedShow:  More infos  (Show/Hide Ads)


Date: Friday, 22 Jul 2011 19:52
How do I get a detailed configuration of my system?
lscfg

lspv hdisk1 (Will Show disk Size)

lscfg | grep proc (To display the number of processors on your system)

prtconf (Will Show Complete System Info with Type No. Serial No)

lsvg (All Vg Will be displayed)

lscfg -vp | grep -ip cabinet (Will Show Cabinet Type)

lsdev -Cc disk (Will show No of disk installed)

lsslot -c pci (Will show all pci device info)


How would I know if I am running a 32-bit kernel or 64-bit kernel?

To display if the kernel is 32-bit enabled or 64-bit enabled, type:

bootinfo -K

To display if the hardware is 32-bit or 64-bit, type:

bootinfo -y

What version, release, and maintenance level of AIX is running on my system?

oslevel -r

To display real memory in kilobytes (KB), type one of the following:

bootinfo -r

lsattr -El sys0 -a realmem


How do I mount a CD?

mount -V cdrfs -o ro /dev/cd0 /cdrom

How do I change the size of a file system?

chfs -a size=+1000000 /usr

How do I display information about installed filesets on my system?

lslpp -l

How do I determine if all filesets of maintenance levels are installed on my system

instfix -i | grep ML

How do I determine the amount of paging space allocated and in use?

lsps -a

How do I increase a paging space?

chps -s 3 hd6

How do I reduce a paging space?

chps -d 4 hd6

How to create a volume group?

mkvg -y name_of_volume_group -s partition_size list_of_hard_disks

How do I display all logical volumes that are part of a volume group (for
example, rootvg)?


lsvg -l rootvg

How do I increase the size of a logical volume?

extendlv lv05 3

How do I list information about logical volumes?

lslv lv1

To show volume groups in the system, type:

lsvg

To show all the characteristics of rootvg, type:

lsvg rootvg

To show disks used by rootvg, type:

lsvg -p rootvg

How to add a disk to a volume group?

extendvg VolumeGroupName hdisk0 hdisk1 ... hdiskn

How do I identify the network interfaces on my server?

lsdev -Cc if
ifconfig -a

How do I activate a network interface?
ifconfig tr0 up







Author: "shailesh (shaileshbhanushali@gmail.com)"
Send by mail Print  Save  Delicious 
Date: Friday, 22 Jul 2011 19:12

System Administration Tools
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/bin/admintool
/usr/sbin/sam
/stand/sysinstall
/bin/linuxconf
/usr/bin/smit (GUI), /usr/bin/smitty
Disk Space and Information
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/sbin/df
/usr/bin/df
/bin/df
/bin/df
/usr/bin/df
/usr/sbin/df -k
/usr/bin/bdf
/bin/df
/bin/df
/usr/bin/df -k
/usr/sbin/mount, umount
/sbin/mount, umount
/sbin/mount, umount
/bin/mount, umount
/sbin/mount, umount
/usr/sbin/devinfo
/usr/sbin/diskinfo /dev/rdsk/device_file
Kernel Configuration
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/etc/system
/stand/system
/usr/src/sys
/usr/src/linux
chdev -l sys0 -a
Processes
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/bin/ps -ef
/usr/bin/ps -ef
/bin/ps -axj
/bin/ps -ef
/bin/truss
tusc
/usr/bin/truss
/usr/bin/strace
syscalls
/usr/bin/iostat
/usr/bin/iostat
/usr/sbin/iostat
/usr/bin/iostat
/usr/ucb/users
/usr/bin/users
/usr/bin/users
/usr/bin/users
/usr/bin/users
/usr/bin/prstat
/usr/bin/top
/usr/bin/top
/usr/bin/top
/usr/bin/top
Physical Memory
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/sbin/dmesg | grep mem /usr/sbin/prtconf | grep Memory
/etc/dmesg | grep -i phys
/sbin/dmesg | grep "real mem"
grep MemTotal /proc/meminfo
bootinfo -r
Hardware Status/Information
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
dmesg
dmesg
dmesg
dmesg
errpt -a
/usr/bin/arch -k
/usr/bin/model
/bin/arch
/usr/bin/uname -m
/usr/bin/uname -m
"Unique" ID
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/sbin/dmesg | grep Ether
/usr/sbin/lanscan
/usr/bin/hostid
/usr/sbin/lanscan, /usr/bin/uname -i
/usr/bin/hostid
/usr/sbin/hostid
Swap
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/sbin/swap -a
/usr/sbin/swapon -a
/sbin/swapon -a
/sbin/swapon -a
swapon -a
/usr/sbin/swap -l
/usr/sbin/swapinfo
/usr/sbin/swapinfo
/usr/bin/free
lsps -a
vmstat
vmstat
vmstat
vmstat
vmstat
System Files
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/etc/rc#.d
/sbin/rc#.d
/etc/rc*
/etc/rc#.d/
/etc/rc#.d
/sbin/init.d
/etc/init.d/
/etc/vfstab
/etc/fstab
/etc/fstab
/etc/fstab
/etc/filesystems
/etc/inet/hosts
/etc/hosts
/etc/hosts
/etc/hosts
/etc/shadow
/etc/passwd
/etc/master.passwd
/etc/shadow
/etc/security/passwd
/etc/group
/etc/group, /etc/logingroup
/etc/group
/etc/group
/etc/format.dat
/etc/disktab
/etc/disktab
The X Window System
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/openwin/bin/xterm
/usr/bin/X11/xterm
/usr/X11R6/bin/xterm
/usr/X11R6/bin/xterm
/usr/openwin/bin/xhost
/usr/bin/X11/xhost
/usr/X11R6/bin/xhost
/usr/X11R6/bin/xhost
Hostname
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/bin/hostname
/usr/bin/hostname
/bin/hostname
/bin/hostname
/etc/inet/hosts
/etc/hosts
/etc/hosts
/etc/hosts
/usr/bin/uname -a
/usr/bin/uname -ae
/usr/bin/uname -a
/bin/uname -a
Networking
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/sbin/showmount
/usr/sbin/showmount
/usr/bin/showmount
/sbin/showmount
/usr/bin/showmount
/etc/dfs/dfstab
/etc/exports
/etc/exports
/etc/exports
/etc/exports
/usr/sbin/share
/usr/sbin/exportfss
/usr/lib/netsvc/yp/ypbind
/usr/lib/netsvc/yp/ypbind
/usr/sbin/ypbind
/usr/sbin/route
/usr/sbin/route
/sbin/route
/sbin/route
/usr/sbin/route
/usr/sbin/in.routed
/usr/sbin/gated
/sbin/routed
/usr/sbin/gated
/usr/bin/netstat
/usr/bin/netstat
/bin/netstat
/usr/bin/netstat
/usr/sbin/netstat
/usr/bin/rsh
/usr/bin/remsh
/usr/bin/rsh
/usr/bin/rsh
Tape Copies
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/bin/cpio
/usr/bin/cpio
/usr/bin/cpio
/bin/cpio
/usr/sbin/tar
/usr/bin/tar
/usr/bin/tar
/bin/tar
tar cvf /dev/rmt/0m
tar cvf /dev/rmt/0m
tar cvf /dev/rmt/0m file
tar cvf /dev/rmt/0m file
tar xvf /dev/rmt/0m
tar xvf /dev/rmt/0m
Tape Devices
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/vol/dev/dsk/cXtXdX (CD-ROM)
/dev/dsk/c0tXd0 ("X" is address)
/dev/rmt/0m (tape)
/dev/rmt/0m
/usr/bin/eject
/usr/bin/tcio -r
Software
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/sbin/pkgadd
/usr/sbin/swinstall
/usr/sbin/pkg_add
rpm -i[U]vh
installp -a
/usr/sbin/pkginfo
/usr/sbin/swlist
/usr/sbin/pkg_info
rpm -qa
lslpp -L
/usr/sbin/pkgrm
/usr/sbin/swremove
/usr/sbin/pkg_delete
rpm -e
installp [-r|-u]
/usr/bin/showrev -p
/usr/sbin/swlist | grep PH
instfix -ia
/usr/sbin/patchadd
/usr/sbin/swinstall
instfix
/usr/sbin/patchrm
/usr/sbin/swremove
installp -r
/usr/sbin/pkgchk
/usr/sbin/swverify
lppchk
/usr/sbin/swmtool
/usr/sbin/swinstall, /usr/sbin/swremove
/usr/bin/pkgmk
/usr/sbin/swpackage
Daemons
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/bin/cron
/usr/bin/cron
/usr/sbin/cron
/usr/sbin/cron
/usr/bin/atq
/usr/bin/at -q
/usr/bin/atq
/usr/bin/atq
/usr/bin/atrm
/usr/bin/at -r
/usr/bin/atrm
/usr/bin/atrm
Backup/Restore
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/sbin/ufsdump
/usr/sbin/fbackup, dump, rdump
/sbin/dump
backup
/usr/sbin/ufsrestore
/usr/sbin/frecover, restore, rrestore
/sbin/restore
restore
Core Files
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/bin/savecore
/sbin/savecrash
/sbin/savecore
/usr/sbin/crash
/usr/sbin/crashutil
/usr/bin/coreadm
/etc/rc.config.d/savecrash
Disk Formatting
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/sbin/format
/usr/bin/mediainit
/sbin/disklabel [?]
/sbin/mke2fs [?]
Disk Partitioning
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/sbin/format
/usr/sbin/pvcreate, vgcreate, lvcreate
/sbin/fdisk
/sbin/fdisk
Disk Maintenance
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
/usr/sbin/format
/usr/sbin/pvremove, vgremove, lvremove, vgreduce, lvreduce, vgextend, lvextend, pvdisplay, vgdisplay, lvdisplay
Printer/Plotter
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/etc/printers.conf
/usr/lib/lp/model
/usr/bin/lpstat
/usr/bin/lpstat
/usr/bin/lpstat
/usr/bin/lp
/usr/bin/lp
/usr/bin/cancel
/usr/bin/cancel
qcan
/usr/spool/lp/model
/usr/lib/lp/model
Miscellaneous
Solaris 8
HP-UX 10.x 11.x
FreeBSD
Linux
AIX
/usr/ucb/whoami
/usr/bin/whoami
/usr/bin/whoami
/usr/bin/whoami
/usr/bin/dos2unix
/usr/bin/dos2ux
cd /usr/ports/converters/unix2dos
/usr/bin/eject
/usr/bin/tcio -r
/usr/bin/fdformat
/usr/bin/mediainit -f
/usr/sbin/fdformat
/usr/bin/fdformat
/usr/bin/makedev
/usr/sbin/mknod
/sbin/mknod
/bin/mknod
/usr/bin/mpstat
/opt/perf/bin/glance, /opt/perf/bin/gpm
/usr/bin/pagesize
/opt/perf/bin/glance, /opt/perf/bin/gpm
/usr/bin/pagesize
/usr/bin/setfacl
/usr/bin/chacl
/usr/bin/showrev
/usr/bin/uname -a
/usr/bin/tip
/usr/bin/cu
/usr/bin/unix2dos
/usr/bin/ux2dos
/usr/sbin/add_drv
/usr/sbin/mknod, /usr/sbin/insf, /usr/sbin/mksf
/usr/sbin/cfgadm
/usr/sbin/ioscan
/usr/sbin/devfsadm
/usr/sbin/mknod, /usr/sbin/insf, /usr/sbin/mksf
/usr/sbin/dhcpconfig
/sbin/auto_parms
/usr/sbin/dhtadm
/usr/sbin/dhcptools
/usr/sbin/disks
/usr/sbin/mknod, /usr/sbin/insf, /usr/sbin/mksf
/usr/sbin/fdisk
/usr/sbin/lvlnboot, /usr/sbin/lvcreate
/usr/sbin/growfs
/usr/sbin/extendfs, /usr/sbin/fsadm, /usr/sbin/lvextend
/usr/sbin/installboot
/usr/sbin/lvlnboot
/usr/sbin/metaparam
/usr/sbin/lvchange, /usr/sbin/vgchange
/usr/sbin/metastat
/usr/sbin/lvdisplay, /usr/sbin/pvdisplay, /usr/sbin/vgdisplay
/usr/sbin/metasync
/usr/sbin/lvsync, /usr/sbin/vgsyncr
/usr/sbin/nslookup
/usr/bin/nslookup
/usr/sbin/nslookup
/usr/bin/nslookup
/usr/sbin/poweroff
/usr/sbin/shutdown
/sbin/shutdown -h now
shutdown -h now
/usr/sbin/prtconf
/usr/bin/getconf
/usr/sbin/prtconf | grep -i memory
/usr/sbin/swapinfo
/usr/sbin/rem_drv
/usr/sbin/rmsf
/usr/sbin/strace
/usr/bin/strace
/usr/bin/strace [!]
/usr/sbin/strclean
/usr/bin/strclean
/usr/sbin/strerr
/usr/bin/strerr
/usr/sbin/sysdef
/usr/sbin/ioscan, /usr/sbin/sysdef
lsdev
/usr/sbin/tapes
/usr/sbin/mknod, /usr/sbin/insf, /usr/sbin/mksf
/usr/ucb/fasthalt
/usr/sbin/reboot -q, /usr/sbin/shutdown

FreeBSD/Linux/Perl/MySQL Consulting by Nesbitt & Associates.
Author: "shailesh (shaileshbhanushali@gmail.com)"
Send by mail Print  Save  Delicious 
Date: Monday, 15 Dec 2008 01:15

Hi, just wanted to make sure I give you enough time to update your links - most of the content of this website will be integrated back into my Unix Tutorial website, as this domain will become inactive in two weeks or so.

Unix links

Here's what you should use from now on:

Author: "Gleb Reys" Tags: "Site updates"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 17 Nov 2008 14:55

ouch command is one of these little but extremely useful tools in Unix which you may have used for quite sometime before realizing their full potential. In short, it updates file timestamps - access and modification ones (atime and mtime respectively).

Why modify file timestamps?

There are quite a few legitimate reasons why you may want to update timestamps on a certain file. Ranging from source control approaches to storage usage analysis, there are processes out there which rely on the timestamps associated with each file and directory of yours.

After all, it's always useful to know when the file was last modified or when somebody tried to access its contents.

Changing timestamps of a time to the current system time

The default behavior of touch command is to change all three timestamps associated with a file to the current system time.

You simply specify the filename as a command line parameter, no oother options are needed. If there isn't a file with the specified name, touch command will create it for you if permissions allow it:

ubuntu$ ls try
ls: try: No such file or directory
ubuntu$ touch try
ubuntu$ ls try
try
ubuntu$ stat try
  File: `try'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d      Inode: 655596      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   greys)   Gid: (  113/   admin)
Access: 2008-11-17 08:03:02.000000000 -0600
Modify: 2008-11-17 08:03:02.000000000 -0600
Change: 2008-11-17 08:03:02.000000000 -0600
ubuntu$ date
Mon Nov 17 08:03:05 CST 2008

As you can see from the example, the file which isn't originally found, gets created by the touch command and gets its timestamps set to the current system time and date.

Changing file timestamps to a specific date and time

If you have a specific time and date you would like to be used for all the timestamps of a file or directory, touch command will gladly accempt a timestamp template with -t command line option.

Template for the timestamp is quite thorough: [[CC]YY]MMDDhhmm[.ss], but it's entirely up to you whether to specify the year (either two-digit or a full form) or not.

This example resets the date to October 16th:

ubuntu$ touch -t 10161000 ./try
ubuntu$ stat ./try
  File: `./try'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d      Inode: 655596      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   greys)   Gid: (  113/   admin)
Access: 2008-10-16 10:00:00.000000000 -0500
Modify: 2008-10-16 10:00:00.000000000 -0500
Change: 2008-11-18 03:54:10.000000000 -0600

As you can see from the output, both access time and modification time got updated. The reason change time (ctime) is set to a different date is because this field reflects the last update to the inode behind a file, and always reflects the current time. In other words, it's set to Nov 18th 2008 because of the date of writing this example.

If you fancy adding a year to the timestamp specification, you can specify something from both past and future.

Here's how easy it is to set atime and mtime to the Oct 16th, 2010 date:

ubuntu$ touch -t 201010161000 ./try
ubuntu$ stat ./try
  File: `./try'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d      Inode: 655596      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   greys)   Gid: (  113/   admin)
Access: 2010-10-16 10:00:00.000000000 -0500
Modify: 2010-10-16 10:00:00.000000000 -0500
Change: 2008-11-18 03:57:30.000000000 -0600

Modifying atime of a file in Unix

Similar to the commands above, you can use -a option to make touch only update the access time field of a file:

ubuntu$ touch -at 200010161000 ./try
ubuntu$ stat ./try
  File: `./try'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d      Inode: 655596      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   greys)   Gid: (  113/   admin)
Access: 2000-10-16 10:00:00.000000000 -0500
Modify: 2010-10-16 10:00:00.000000000 -0500
Change: 2008-11-18 04:05:22.000000000 -0600

Modifying mtime of a file in Unix

If you're interested in updating the modification date only, use -m option:

ubuntu$ touch -mt 200510161000 ./try
ubuntu$ stat ./try
  File: `./try'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d      Inode: 655596      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   greys)   Gid: (  113/   admin)
Access: 2000-10-16 10:00:00.000000000 -0500
Modify: 2005-10-16 10:00:00.000000000 -0500
Change: 2008-11-18 04:07:12.000000000 -0600

Using a reference file to set atime and mtime

Finally, the really useful option for synchronizing access and modification time fields between multiple files is to use reference file. A reference file is the file which already has the timestamps you'd like to copy:

ubuntu$ stat /etc/lsb-release
  File: `/etc/lsb-release'
  Size: 97              Blocks: 8          IO Block: 4096   regular file
Device: 801h/2049d      Inode: 1278451     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2008-11-14 05:30:09.000000000 -0600
Modify: 2007-04-12 01:02:52.000000000 -0500
Change: 2007-09-26 02:41:20.000000000 -0500

By specifying this file using a -r option, you can use the touch command to set the same atime and mtime values to any file of yours:

ubuntu$ touch -r /etc/lsb-release ./try
ubuntu$ stat ./try
  File: `./try'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d      Inode: 655596      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   greys)   Gid: (  113/   admin)
Access: 2008-11-14 05:30:09.000000000 -0600
Modify: 2007-04-12 01:02:52.000000000 -0500
Change: 2008-11-18 04:09:02.000000000 -0600

See also:

Author: "Gleb Reys" Tags: "Unix file operations"
Comments Send by mail Print  Save  Delicious 
Date: Sunday, 21 Sep 2008 10:51

Here are the articles I found interesteding this week, leave a comment with a link if you have something interesting to share:

Author: "Gleb Reys" Tags: "blog"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 15 Sep 2008 08:00
WordPress

WordPress

Gone are the days of manually clipping the WordPress logo from the official website! Last week I’ve discovered a wonderful page with all the official WordPress logos and buttons offered in PDF (with vector graphics) and PNG versions of everything.

There’s a set of WordPress wallpapers and a neat table with current colors used by WordPress engine.

Like WordPress? Find out more:

Author: "Gleb Reys" Tags: "wordpress"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 08 Sep 2008 22:36

Looks like WordPress 2.6.2 with a few fixes is out, so I’ve just upgraded all my blogs to this new milestone.

For all the details, read the official WordPress 2.6.2 announcement or glance through the list of bugs fixed in 2.6.2 release.

See also:

Author: "Gleb Reys" Tags: "wordpress"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 08 Sep 2008 07:11

It was bound to happen: I’ve joined Twitter! It would be great to hear from you there!

Follow me or leave your Twitter name in comments below so that I can follow you:

http://twitter.com/PerfectBlogger

Author: "Gleb Reys" Tags: "blog"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 03 Sep 2008 05:07

Looks like Google has taken one more shortcut to providing best service to its fans: as of yesterday, Google’s very own Internet browser codenamed Google Chrome, is available for download.

What is Google Chrome?

My first impression is that Google Chrome is a slick ultra-light browser with minimalistic yet intuitive interface and a minimal set of settings. There’s no fixed status bar, there’s no main menu, there’s just the address bar (called Omnibox because it also combines a search bar).

The tabbing works very smoothly, and overall you kind of feel there’s something missing simply because there’s only the page content and a very subtle set of controls. You get used to such a simplicity very quickly, though.

Here’s how Google Chrome looks:

Google Chrome

Performance of Google Chrome vs Firefox

I haven’t noticed much of a performance boost yet, but maybe it’s just because I need to play with this new browser a bit more. All the pages load quickly, but I’ve yet to see the ones which load much better than in my Firefox. ZDnet did some testing already and it shows that Google Chrome is quite fast.

What’s really cool is the really simple interface and intuitive searching - as you type a URL, Omnibox tries to guess what website you’re trying to get to. Works like a charm for many well known websites!

One of the main reasons Google came up with its own browser is performance of Google services and apps in modern browsers. Firefox is not ideal, although with a bit of tweaking you can get it to work pretty fast. Is it very likely that Google Chrome, being a highly specialized product, will be the best for GMail, Google Calendar and other services - but it may take some getting used to. Google also claims Chrome will be better for most websites, so it does seem like the optimizations will have a generic nature rather than a Google-specific services customization - I think it’s great news.

That’s it! Have a look at the browser itself, I think it’s a great move for Google, but would hate to see it as a direct competition to my favourite Firefox. I think the fact that these two products both called web browsers still doesn’t make a fair apples-to-apples comparison because Firefox has got quite a history and is much more universal as it is. I’m a long way from changing my preference for Firefox to any other browser, but must admit that Google Chrome seems to have done quite a neat and easy to use browser - time will show what Google will make of it.

See also:

Author: "Gleb Reys" Tags: "SEO, blog"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 29 Aug 2008 04:38

man is one of the very first Unix commands everyone learns. It shows a brief manual for most of the commands available on your Unix-like OS and provides cross-references to other similar manuals.

What is man command used for

Many Unix commands are quite useful even if run without command line parameters, but as soon as you reach the next comfort level, you start wondering about extracting even more from the same command. This is when reading manuals becomes vital, and man offers a great way to explore them.

All Unix-like systems are provided with extensive manuals. Even if you don't have the material printed on paper, you still have plenty of information installed with your OS.

Most usually, manual pages are found under /usr/share/man directory. Manuals are not presented in clear text - there's a markup language commands which should be interpreted by the man command.

What is a Unix manual page (manpage)

All the manuals for Unix commands are split into clearly marked sections:

  • NAME - command name as it should be typed
  • SYNOPSIS - syntax for running a command - all the possible command line options
  • DESCRIPTION - textual description of what a command is used for
  • OPTIONS - full list of command line options with thorough explanations
  • FILES - files which are used by a command
  • SEE ALSO - other relevant commands you might want to look at
  • BUGS - known bugs and limitations of a command
  • AUTHOR - list of command authors, developers and most current maintainers

A manual page generated by man command is nothing but a clear text you can access from most basic Unix shell session, formatted as per your terminal capabilities (most often you see that section names are shown in bold font, but that's about it).

Using man command in Unix

The simplest way to get help in Unix is to run man command and specify a name of another Unix command as a parameter. Naturally, the first thing you should do is to have man show you a manual for itself:

ubuntu$ man man

This is how it would look (click the image o get the full resolution):

See also:

Author: "Gleb Reys" Tags: "Site updates"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 29 Aug 2008 03:30

runlevel is a basic Unix command aimed to do one simple task: report the runlevel of your Unix OS.

How runlevel command works

Your Unix system carefully logs information about every login session in special files. /var/run/utmp is the file containing information about everyone who's currently logged in, and since every record contains a runlevel information, it makes sense to use this file as a proof of the current OS runlevel.

runlevel command reads /var/run/utmp file and extracts the most recent login entry. It then uses this entry to extract the current and previous runlevel information from it.

Using runlevel command

Simply run the command without any parameters:

redhat$ runlevel
N 5

As it was said earlier, the two numbers shown are supposed to be previous and current Unix runlevels.

However, the previous runlevel information is not usually found in the most recent login entry simply because runlevel hasn't changed,

so the command prints "N" instead of it.

Looking at the output above, you can see that the current runlevel is 5.

See also:

Author: "Gleb Reys" Tags: "System status commands"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 22 Aug 2008 18:19

After the last round of reviewing my online projects, I’ve decided to change not only focus but WordPress theme for PerfectBlogger.

As of today, this website will have Brian Gardner’s Vertigo theme. My main reason for changing the look of Perfect Blogger is to declutter the pages of this blog, so have a look and let me know!

Author: "Gleb Reys" Tags: "blog"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 21 Aug 2008 09:04

time command is a basic tool in Unix which allows you to keep track of the system resources when running a specified Unix command.

time command in Unix

Sometimes it is quite important to know exactly how much of your system resources are used for running a particular command. This is where the time command can be used. It's a really simple tool which takes any command line as a parameter, runs the command and then reports the system resources usage:

ubuntu# time du -sk /var
4228720 /var

real    0m17.747s
user    0m0.010s
sys     0m0.080s

In this example, a du command is run to gather the cumulative disk space taken up by the /var directory, and a report of used time is presented.

This is what each of these times mean:

  • real - real time, in other words a number of seconds, minutes and sometimes hours and even days it takes for the specified command to complete
  • user -user time, that is the time spent by your OS executing the user code of your command - every instruction of the specified command which was executed in user mode.
  • sys - system time, the amount of time spent by your OS running a system kernel code - instructions in response to the system calls initiated by your command

Real time vs user time vs system time

As you can see, the real time is not a sum of the other two - this is because only the system resources are reported, which is essentially just the CPU time.

Since we ran the I/O intensive command, most of the time it took for du to complete was spent waiting for the I/O operations to complete - as you can see from the example, the CPU time was minimal.

While the necessary file and directory attributes were being read from the disk, both the user time and the system time counters for the command were not clocking anything - your OS process scheduler was busy spending valuable CPU cycles to execute code for other processes.

See also:

Author: "Gleb Reys" Tags: "System status commands"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 10 Jul 2008 09:56

For all of you who were hoping to give Wordze keyword research service a try, here’s your next chance!

If you register for Wordze between now and July 14th, you’ll have to pay only $4 for the month of July, with $38.98 for every month after (you can cancel at the end of July if you change your mind).

I find Wordze to be one of the most useful and affordable tools online, and thanks to offers like this almost everyone can give it a try at virtually no cost.

Author: "Gleb Reys" Tags: "SEO, special offer, wordze"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 25 Jun 2008 08:31

Firefox 3 logo

Sam Allen from Dot NET Pearls has written a great program to observe the memory taken up by each of the 5 most popular browsers. His experiment was to taken snapshots of memory usage numbers every 3 seconds for a period of 3 hours. The graphs posted on his Firefox 3 Memory Benchmarks and Comparison page are quite interesting, particularly showing that Firefox 3 is ahead of all the competitors with its rather stable and humble memory requirements.

I’ve been using Firefox 3 full-time since RC2, and must say I’m really impressed with its stability and performance.

Link: Firefox 3 Memory Benchmarks via Slashdot: Real-World Firefox 3 Memory Usage.

Author: "Gleb Reys" Tags: "firefox, firefox3"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 17 Jun 2008 08:59

Just a reminder: today, June 17th 2008, is the official Firefox 3 download day - Mozilla foundation attempts to set a new Guinness record by having the latest release of Firefox downloaded the most within 24 hours.

You still have the time to make a pledge and download it: Firefox 3 download day.

Author: "Gleb Reys" Tags: "firefox, firefox 3"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 12 Jun 2008 15:24

top is a basic Unix command which is very useful for observing the current state of your Unix system, by default presenting you the list of top users of your system's resources - CPU shares and memory.

Basic usage of the top command

By default, you run top without any parameters, and it shows you a full screen (or full window of your terminal) with the current status of your system and a list of processes using most of its CPU:

ubuntu$ top
top - 13:29:09 up 2 days,  7:13,  4 users,  load average: 0.07, 0.02, 0.00
Tasks: 148 total,   1 running, 147 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.6%us,  0.5%sy,  0.0%ni, 97.3%id,  1.6%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4051792k total,  4026104k used,    25688k free,   359168k buffers
Swap:  4096492k total,    24296k used,  4072196k free,  2806484k cached
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 7629 greys     20   0  749m 291m  28m S    1  7.4  16:51.40 firefox
19935 greys     20   0  133m  14m  10m S    0  0.4   2:38.52 smplayer
    1 root      20   0  4020  880  592 S    0  0.0   0:00.96 init
    2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT  -5     0    0    0 S    0  0.0   0:00.04 migration/0
    4 root      15  -5     0    0    0 S    0  0.0   0:00.90 ksoftirqd/0
    5 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/0
    6 root      RT  -5     0    0    0 S    0  0.0   0:00.06 migration/1
    7 root      15  -5     0    0    0 S    0  0.0   0:01.32 ksoftirqd/1
    8 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/1
    9 root      15  -5     0    0    0 S    0  0.0   0:02.14 events/0
   10 root      15  -5     0    0    0 S    0  0.0   0:01.44 events/1
   11 root      15  -5     0    0    0 S    0  0.0   0:00.00 khelper
   44 root      15  -5     0    0    0 S    0  0.0   0:01.26 kblockd/0
   45 root      15  -5     0    0    0 S    0  0.0   0:01.98 kblockd/1
   48 root      15  -5     0    0    0 S    0  0.0   0:00.00 kacpid
   49 root      15  -5     0    0    0 S    0  0.0   0:00.00 kacpi_notify
  153 root      15  -5     0    0    0 S    0  0.0   0:00.00 kseriod
  203 root      15  -5     0    0    0 S    0  0.0   0:03.56 kswapd0
  246 root      15  -5     0    0    0 S    0  0.0   0:00.00 aio/0
  247 root      15  -5     0    0    0 S    0  0.0   0:00.00 aio/1
 1595 root      15  -5     0    0    0 S    0  0.0   0:00.00 ksuspend_usbd
 1601 root      15  -5     0    0    0 S    0  0.0   0:00.02 khubd
 1612 root      15  -5     0    0    0 S    0  0.0   0:00.08 ata/0
 1615 root      15  -5     0    0    0 S    0  0.0   0:08.28 ata/1
 1616 root      15  -5     0    0    0 S    0  0.0   0:00.00 ata_aux

Output of the top command explained

These are the elements which default top output consists of:

Unix system uptime and average load

This is the line of top which confirms how many hours (or even days!) your system has been up, shows you the number of logged in users, and reports the average system load numbers for the last minute, 5 minutes and 15 minutes.

top - 13:29:09 up 2 days,  7:13,  4 users,  load average: 0.07, 0.02, 0.00

In this line:

  • 13:29:09 is the current time
  • 2 days, 7:13 is the uptime
  • 4 users shows how many users currently use your system
  • 0.07 - average load for the last minute
  • 0.02 - average load for the last 5 minutes
  • 0.00 - average load for the last 15 minutes

Unix tasks stats

Here you can see how many tasks are currently running on your system. Tasks here mean processes, and the main listing will show you the task names (in the COMMAND column) and the PIDs.

Tasks: 148 total,   1 running, 147 sleeping,   0 stopped,   0 zombie

CPU(s) status

Current CPU state, averaged for the number of CPUs installed in your system, is represented in this line:

Cpu(s):  0.6%us,  0.5%sy,  0.0%ni, 97.3%id,  1.6%wa,  0.0%hi,  0.0%si,  0.0%st

Here are the explanations for each parameter:

  • us - User CPU time. The time the CPU has spent running users’ processes with default priorities
  • sy - System CPU time. The time the CPU has spent running the kernel and its processes
  • ni - Nice CPU time. The time the CPU has spent running users’ proccess that have been prioritized up using nice command
  • wa - I/O wait. Amount of time the CPU has been waiting for I/O operations to complete
  • hi - Hardware IRQ. The amount of time the CPU has been servicing hardware interrupts
  • si - Software Interrupts. The amount of time the CPU has been servicing software interrupts
  • st - Steal Time. The amount of CPU ’stolen’ from this virtual machine by the hypervisor for other tasks (such as running another virtual machine) - a fairly recent addition to the top command, introduced with the increased virtualization focus in modern operating systems

Physical memory usage stats

Memory stats line gives you a summary of how much physical memory you have on your system, and how much of it is currently used or available for the use.

Modern Linux systems are buffering quite a lot for improved performance, which means you rarely get to see all your physical RAM free - the more your system stays up and running, the more of its recently used data ends up being buffered.

In this line, you can see how quite a bit is taken up by the buffers:

Mem:   4051792k total,  4026104k used,    25688k free,   359168k buffers

Swap usage stats

Swap statistics highlight how actively your system uses the swap space - most of it should not be used on a healthy system, although seeing substantial amount of swap memory cached is quite normal. Bear in mind that these are caches held in physical memory, so in this example these 2.8Gb of cached swap is responsible for most of the 4Gb physical RAM taken up and reported as used in the above stats for memory

Swap:  4096492k total,    24296k used,  4072196k free,  2806484k cached

List of the tasks (processes) running on your system

This is the main part of the top output, which looks like this (output is abridged):

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 7629 greys     20   0  749m 291m  28m S    1  7.4  16:51.40 firefox
19935 greys     20   0  133m  14m  10m S    0  0.4   2:38.52 smplayer
    1 root      20   0  4020  880  592 S    0  0.0   0:00.96 init
    2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT  -5     0    0    0 S    0  0.0   0:00.04 migration/0
    4 root      15  -5     0    0    0 S    0  0.0   0:00.90 ksoftirqd/0
    5 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/0
    6 root      RT  -5     0    0    0 S    0  0.0   0:00.06 migration/1

As you can see from this list, you're given all the vital information about each process running on your Unix system:

  • PID - process ID
  • USER - username for the owner of each process
  • PR - process priority (RT means a Real Time priority class - used for system processes)
  • NI - priority set by nice utility
  • VIRT - the amount of virtual memory used by a process: code, data and shared libraries plus pages that have been swapped out
  • RES - the resident part of a process - how much of it resides in the physical memory (non-swapped memory)
  • SHR - shows you the size of potentially shared memory segments for a process
  • S - the current state of each process
  • %CPU - percentage of the time shares CPU spends running a particular process
  • %MEM - percentage of the physical memory of your system which is used by each process
  • %TIME+ - total time CPUs spent running each process
  • COMMAND - a command used to initiate each process.

I'll be sure to revisit and expand this page at some later stage.

See also:

Author: "Gleb Reys" Tags: "Process management, System status comman..."
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 12 Jun 2008 08:57

Just wanted to highlight this information for you, although it’s not exactly news - AJAX Libraries API from Google allows everyone to access the latest versions of most popular JavaScript frameworks right from Google servers.

What is AJAX Libraries API?

If you were looking for a way to simplify your usage of JavaScript frameworks, Google has got you covered: AJAX Libraries API is an architecture which hosts most popular open source JavaScript libraries on Google servers and thus make them highly available to use by any of your pages.

Why use AJAX libraries hosted by Google?

There’s a few advantages to offloading JavaScript libraries onto Google’s servers. Here’s my list:

- no headaches with upgrading your JavaScript libraries - they’re updated automatically so your pages are always using the latest and greatest versions available

- universally available - you can access JavaScript frameworks using the same methods from any pages of yours

- high availability - like everything else on Google servers, your scripts will be safe, fast and highly available - distributed among many Google servers and probably delivered to you from the geographically closest location

What libraries are currently available?

Here are the ones you can start using right now:

The full list of libraries available through AJAX Libraries API can be found here: Google AJAX Libraries, I presume it will be updated as more libraries get hosted there.

Via: Google Hosts Popular JavaScript Libraries @ Google System blog

Author: "Gleb Reys" Tags: "blog"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 11 Jun 2008 11:11

date is a basic Unix command for getting or setting the current time and date on your system. Because it's the easiest way to get current time, this command is extensively used in Unix scripting.

Getting current time and date in your Unix system

The default usage of this command is simple and requires no additional command line parameters:

ubuntu$ date
Wed Jun 11 11:43:52 IST 2008

Using templates to specify the desired date/time format

date command supports template system for printing the current time and date - so you can use it to specify the exact format for representing the time and date information - for example, only print out the day of a month or a current year instead of the whole default timestamp shown above.

Format is text string which begins with the + character, which consists of a number of special parameters starting with the % sign: %B, %d, etc.  If you're using spaces or any other elements in your format string, you need to use double quotes as well.

Here's an example of specifying a format for the date command:

ubuntu$ date "+%B %d, %Y"
June 11, 2008

In this example, the %B represents the full name of the current month, %d is the day of the month, and %Y is the four-digit representation of the current year.

Here are some of the most useful parameters used for date format specification:

%a     locale’s abbreviated weekday name (e.g., Sun)
%A     locale’s full weekday name (e.g., Sunday)
%b     locale’s abbreviated month name (e.g., Jan)
%B     locale’s full month name (e.g., January)
%c     locale’s date and time (e.g., Thu Mar  3 23:05:25 2005)
%C     century; like %Y, except omit last two digits (e.g., 21)
%d     day of month (e.g, 01)
%D     date; same as %m/%d/%y
%e     day of month, space padded; same as %_d
%F     full date; same as %Y-%m-%d
%g     last two digits of year of ISO week number (see %G)
%G     year of ISO week number (see %V); normally useful only with %V
%h     same as %b
%H     hour (00..23)
%I     hour (01..12)
%j     day of year (001..366)
%k     hour ( 0..23)
%l     hour ( 1..12)
%m     month (01..12)
%M     minute (00..59)
%R     24-hour hour and minute; same as %H:%M
%s     seconds since 1970-01-01 00:00:00 UTC
%S     second (00..60)
%T     time; same as %H:%M:%S
%u     day of week (1..7); 1 is Monday
%w     day of week (0..6); 0 is Sunday
%x     locale’s date representation (e.g., 12/31/99)
%X     locale’s time representation (e.g., 23:13:48)
%y     last two digits of year (00..99)
%Y     year

Unix date manipulations

If you're interested in confirming any date/time information about dates in the past or in the future, you will find all the answers in my article here: Easy Date Calculations in Unix Scripts.

Unix epoch time

Since time in most Unix systems is calculated against the Unix epoch (January 1, 1970), you can use date command to confirm the exact number of seconds elapsed since this time on your Unix system:

ubuntu$ date +%s
1213182257

See also:

Author: "Gleb Reys" Tags: "System status commands, date, scripts, t..."
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 29 May 2008 11:00

getent is Unix command which helps you query one of the following administrative databases in Unix: passwd, group, hosts, services, protocols, or networks.

Administrative databases in Unix

As you can probably see from their names, the administrative databases are here to help you gather the most vital information about your environment:

  • passwd - can be used to confirm usernames, userids, home directories and full names of your users
  • group - all the information about Unix groups known to your system
  • services - all the Unix services configured on your system
  • networks - networking information - what networks your system belongs to
  • protocols - everything your system knows about network protocols

How to use getent

My home PC has a hostname of ubuntu. If I ever need to double-check which IPs this hostname points to, here's how I can use getent:

ubuntu$ getent hosts ubuntu
127.0.1.1       ubuntu
192.168.0.2     ubuntu

Using getent to find a UID by username

getent accepts various keys when searching in databases. For the passwd one, you can user either username or user id (UID) to search the database.

ubuntu$ getent passwd greys
greys:x:1000:1000:Gleb Reys,,,:/home/greys:/bin/bas

Using getent to find a username by UID

Like I said, the opposite will work as well:

ubuntu$ getent passwd 1000
greys:x:1000:1000:Gleb Reys,,,:/home/greys:/bin/bash

See also:

  • id - print user identity
  • who - see who is logged into the system
Author: "Gleb Reys" Tags: "Unix users"
Comments Send by mail Print  Save  Delicious 
Next page
» You can also retrieve older items : Read
» © All content and copyrights belong to their respective authors.«
» © FeedShow - Online RSS Feeds Reader