Your Ad Here

Kamis, 08 September 2005

Unix Tip: CHECKING FOR FILESYSTEMS FULL

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 2442 - September 8, 2005

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


CHECKING FOR FILESYSTEMS FULL

Many times we have a file systems which is too full. To quickly find out which are the file system We could use:

df -k|awk '{if ( $4 >= 90 ) print $4," " $7 }'


Check the fields on your flavor, it may not be $4 or $7. Yours could be different.


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Rabu, 07 September 2005

Unix Tip: ANOTHER CASE TRANSLATION

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 2441 - September 7, 2005

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


ANOTHER CASE TRANSLATION

If you have occasion where you need to translate upper case to lower and vice versa, and happen to run a ksh, enter the following functions into your .profile:

function trans
{
tr '[:upper:]' '[:lower:]' < $1 > $2
}
function TRANS
{
tr '[:lower:]' '[:upper:]' <$1 > $2
}


The first function will translate all uppercase letters in the first file (argument) to lowercase in the second file.

The second function TRANS does the exact opposite.


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Selasa, 06 September 2005

Unix Tip: TEST TROUBLES IF STRING IS EMPTY

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 2440 - September 6, 2005

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


TEST TROUBLES IF STRING IS EMPTY

(1) bad ex.
if [ `echo "$OPTARG" | sed '/^[0-9][0-9]*$/!d` = "" ]

(2) fixed ex.
if [ `echo "$OPTARG" | sed '/^[0-9][0-9]*$/ s//X/'`= "X" ]

(3) another fixed ex. (Bourne Shell, ksh)
if [ -n "`echo "$OPTARG" | sed '/^[0-9][0-9]*$/!d'`" ]

(1) This produces an easy to overlook error. On success and the lack of double quotes on the left side cause test to think there is no parameter, producing an error (1). This is because the result is an empty string without quotes and test doesn't know that it is dealing with a string, no parameter seen.

Adding a character to the beginning of each string is a trick to fix it (2). The test command sees a string and simply compares as normal, passing over the pair of initial and equal characters.

Another fix (3) is to surround the empty/not empty string with double quotes. Test will see the empty string and things work as normal. This (3) works in Bourne Shell and ksh but NOT in csh.

Simple ex.
$ foo=""
$ test -n $foo # fails
$ test -n `echo $foo` # fails
$ test -z `echo x$foo` # works, might throw off the logic
$ test -n "`echo $foo`" # works in sh & ksh


This tip generously supported by: bigoldbulldog@hotmail.com


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Senin, 05 September 2005

Unix Tip: ANOTHER PROCESS FINDER

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 2439 - September 5, 2005

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


ANOTHER PROCESS FINDER

psfind command:

Here is a quick script that you can use to filter the list of active processes to only those that contain a specified string.

Edit into the file
/usr/local/bin/psfind

ps -ef|grep -i $1|grep -iv grep

Change permissions so that it is executable
#chmod a+x,go-w /usr/local/bin/psfind

Use it:
#/usr/local/bin/psfind oracle


This tip generously supported by: bill.anglea@oracle.com


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Minggu, 04 September 2005

Unix Tip: VI REVERSAL

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 2438 - September 4, 2005

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


VI REVERSAL

In vi editor you can reverse the order of lines by just executing the following ed command at the : prompt.

g/^/m0


This tip generously supported by: ashutosh.tiwari@ind.xerox.com


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Sabtu, 03 September 2005

Unix Tip: BANNERS ON TELNET

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 2437 - September 3, 2005

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BANNERS ON TELNET

For showing the banner on a telnet session.

Add the following in /etc/inetd.conf

telnet stream tcp nowait root /usr/lbin/telnetd telnetd -b /etc/issue

The -b option then the banner file after this allow inetd to reread the conf file by , inetd -c.

After this you will be getting your banner on telnet session.


This tip generously supported by: tb.unnikrishnan@citicorp.com

--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Jumat, 02 September 2005

Unix Tip: MOUNTING CD'S ON HPUX

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 2436 - September 2, 2005

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


MOUNTING CD'S ON HPUX

If you want to mount an ISO 9660 CDROM on HP-UX or a ISO 9660 CDROM with RockRidge Interchange Format you have to start pfs_mountd and pfsd.

# /usr/sbin/pfs_mountd &
[3] 1969
# /usr/sbin/pfsd &
[4] 1970

Edit or create the file
/etc/pfs_fstab

/dev/dsk/c0t4d0 /ISO_CDROM pfs-iso9660 xlat=unix 0 0
/dev/dsk/c0t4d0 /ISO_RR_CDROM pfs-rrip xlat=unix 0 0

Create the dirs, if they don't exist

# ls -dl /ISO*
drwxr-xr-x 2 root root 4 Apr 2 20:44 ISO_CDROM
drwxr-xr-x 2 root root 4 Apr 2 20:44 ISO_RR_CDROM

Now it is easy to mount
ISO CDROMs

# pfs_mount /ISO_CDROM
# ls -l /ISO_CDROM
drwxr-xr-x 2 root root 4488 May 6 1988 cdsample
# pfs_umount /ISO_CDROM

Or with long filenames

# pfs_mount /ISO_RR_CDROM
# ls -l /ISO_RR_CDROM
-r--r--r-- 1 root root 4488 Nov 5 19:00 Copyright
dr-xr-xr-x 2 root root 1469 Oct 13 19:01 pictures_from_susi


This tip generously supported by: tomschit@ti-voyager.fbe.fh-weingarten.de

--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Your Ad Here
Free Automatic Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink