=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3430 - June 30, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ECHO LINES TO A BLANK
To echo all lines in a
file upto the first blank
line use the following:
awk '$0 ~ /^$/ {exit;} {print $0;}' <file_name>
The awk script can be used
for printing lines upto the
first occurence of any
pattern.
Just substitute ^$ with
the pattern.
I wrote this script to parse
http server headers.
This tip generously supported by: anand@anandraman.net
--------------------------------------------------------------------------
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, 30 Juni 2012
Jumat, 29 Juni 2012
Unix Tip: STAT FILES
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3429 - June 29, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
STAT FILES
Not supported on all flavors.
To see inode contents (file
size, allocated blocks,
file type, user, group, file
mode, last accessed, last
modified etc) of a file:
$ stat file1 file2 fileN
This tip generously supported by: sachin_m_joshi@yahoo.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
==========================================================================
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3429 - June 29, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
STAT FILES
Not supported on all flavors.
To see inode contents (file
size, allocated blocks,
file type, user, group, file
mode, last accessed, last
modified etc) of a file:
$ stat file1 file2 fileN
This tip generously supported by: sachin_m_joshi@yahoo.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
==========================================================================
Kamis, 28 Juni 2012
Unix Tip: AWK THE STATS
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3428 - June 28, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
AWK THE STATS
AWK script for getting
statistics.
The script gives the
statistics of the default
shell set for the users.
i.e. Number of users using
csh,ksh or sh
$cat stat_demo.awk
#start here
BEGIN{
FS=":"
#seperator is set to :
}
{
#$7, is 7 field in passwd file
stat_array[$7]=stat_array[$7]+1;
}
END{
print "Login-Shell Count" ;
for (i in stat_array) print i, stat_array[i]
#Displays statistics
}
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3428 - June 28, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
AWK THE STATS
AWK script for getting
statistics.
The script gives the
statistics of the default
shell set for the users.
i.e. Number of users using
csh,ksh or sh
$cat stat_demo.awk
#start here
BEGIN{
FS=":"
#seperator is set to :
}
{
#$7, is 7 field in passwd file
stat_array[$7]=stat_array[$7]+1;
}
END{
print "Login-Shell Count" ;
for (i in stat_array) print i, stat_array[i]
#Displays statistics
}
Rabu, 27 Juni 2012
Unix Tip: FTP AUTOMATED TRANSFERS
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3427 - June 27, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
FTP AUTOMATED TRANSFERS
To add to the earlier tip
on automated transfer using
FTP, you can define a macro
by name 'init' which will
automate the whole transfer.
Defining the macro.
In the .netrc file after the
definition for the machine
name,add the following
definition.
macdef init
bin
hash
cd <directory>
!cd <directory>
put/get <filename>
bye
The line begining with macdef
starts the definition of a
macro.All the sub sequent
lines upto a blank line (or
end of file) are part of
the macro.
Now if you type ftp
<machine name> at the prompt,
the whole ftp will happen
automatically.
These macros can also be
defined in any other name in
which case,you will have to
type the macro name at the
ftp prompt for its statements
to get executed.
This tip generously supported by: subha@hitechclub.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
==========================================================================
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3427 - June 27, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
FTP AUTOMATED TRANSFERS
To add to the earlier tip
on automated transfer using
FTP, you can define a macro
by name 'init' which will
automate the whole transfer.
Defining the macro.
In the .netrc file after the
definition for the machine
name,add the following
definition.
macdef init
bin
hash
cd <directory>
!cd <directory>
put/get <filename>
bye
The line begining with macdef
starts the definition of a
macro.All the sub sequent
lines upto a blank line (or
end of file) are part of
the macro.
Now if you type ftp
<machine name> at the prompt,
the whole ftp will happen
automatically.
These macros can also be
defined in any other name in
which case,you will have to
type the macro name at the
ftp prompt for its statements
to get executed.
This tip generously supported by: subha@hitechclub.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
==========================================================================
Selasa, 26 Juni 2012
Unix Tip: AUTOMATIC LOGIN TO REMOTE HOSTS
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3426 - June 26, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
AUTOMATIC LOGIN TO REMOTE HOSTS
Consider two hosts.
host1.domain.com
host2.domain.com
>From hosts(user:deepak),
you wish to logon to
host1(user:paul).
Paul would create a .rhosts
file in his directory
chmod 744 .rhosts
(No write permission for
others) The first line
would contain
host1.domain.com deepak
Now, deepak should be able
to logon to host2.domain.com
as user paul by using rlogin.
Deepak will type
e.g
rlogin hosts.domain.com -l paul
And he should be in.
--------------------------------------------------------------------------
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
==========================================================================
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3426 - June 26, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
AUTOMATIC LOGIN TO REMOTE HOSTS
Consider two hosts.
host1.domain.com
host2.domain.com
>From hosts(user:deepak),
you wish to logon to
host1(user:paul).
Paul would create a .rhosts
file in his directory
chmod 744 .rhosts
(No write permission for
others) The first line
would contain
host1.domain.com deepak
Now, deepak should be able
to logon to host2.domain.com
as user paul by using rlogin.
Deepak will type
e.g
rlogin hosts.domain.com -l paul
And he should be in.
--------------------------------------------------------------------------
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, 25 Juni 2012
Unix Tip: LARGES FILES MORE FLAVORS
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3425 - June 25, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
LARGES FILES MORE FLAVORS
Recently a single line
script was posted to UGU
to list the largest files
in a filesystem in order
of descending size.
The script worked as posted
on AIX but required tweaking
for SCO OSR5 and UW7.
Here 'tis for your
edification and enjoyment:
OSR5:
find $1 -type f -size +2048 -xdev -exec ls -s {} | /bin/sort -brut " "
UW7:
find $1 -type f -size +2048 -xdev -exec ls -s {} + | /bin/sort -nr
I placed the script in
/usr/local/bin and removed
the pipe to "more" in the
published version to allow
redirection to a file. I
also arbitrarily added the
"-size +2048" to the find
command to limit the list
to files of 1 Mb or larger;
you may modify or remove as
desired.
Thank you,
Lucky Leavell
--------------------------------------------------------------------------
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
==========================================================================
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3425 - June 25, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
LARGES FILES MORE FLAVORS
Recently a single line
script was posted to UGU
to list the largest files
in a filesystem in order
of descending size.
The script worked as posted
on AIX but required tweaking
for SCO OSR5 and UW7.
Here 'tis for your
edification and enjoyment:
OSR5:
find $1 -type f -size +2048 -xdev -exec ls -s {} | /bin/sort -brut " "
UW7:
find $1 -type f -size +2048 -xdev -exec ls -s {} + | /bin/sort -nr
I placed the script in
/usr/local/bin and removed
the pipe to "more" in the
published version to allow
redirection to a file. I
also arbitrarily added the
"-size +2048" to the find
command to limit the list
to files of 1 Mb or larger;
you may modify or remove as
desired.
Thank you,
Lucky Leavell
--------------------------------------------------------------------------
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, 24 Juni 2012
Unix Tip: HPUX MEMORY RESOURCES
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3424 - June 24, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
HPUX MEMORY RESOURCES
Memory Resources available
on HP system:
# swapinfo
Lists the memory used and
available on that particular
system.
This tip generously supported by: srinu.sasubilli@wipro.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
==========================================================================
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3424 - June 24, 2012
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
HPUX MEMORY RESOURCES
Memory Resources available
on HP system:
# swapinfo
Lists the memory used and
available on that particular
system.
This tip generously supported by: srinu.sasubilli@wipro.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
==========================================================================
Langganan:
Postingan (Atom)