Monday, September 27, 2010

dbms_output.putline()

in order to see the lines on screen of sqlplus.

use SET SERVEROUTPUT on SIZE 100000

Thursday, September 23, 2010

delete subdirecotry and files from a directory but not the directory

sometimes, people need delete only subdirectory and files in a direcotry but not the directory.

for example, we have following directory structure

tti - aa.log
- tt1 - ab.log
tti and tt1 are directories; aa.log and ab.log are files.

if all but tti are required to be deleted.
issue following command:
find tti/* -exec rm -rf {} \;


ATTEN:
find tti -exex tm -rf {} \; will not work because it delet tti too.

Following is the output test in solaris 10

:->find tti -exec ls -ltr {} \;
total 0
-rw-r--r-- 1 oracle dba 0 Sep 23 11:36 aa.log
drwxr-xr-x 2 oracle dba 96 Sep 23 11:37 tt1
-rw-r--r-- 1 oracle dba 0 Sep 23 11:36 tti/aa.log
total 0
-rw-r--r-- 1 oracle dba 0 Sep 23 11:37 ab.log
-rw-r--r-- 1 oracle dba 0 Sep 23 11:37 tti/tt1/ab.log

:->find tti -exec rm -rf {} \;
:->cd tti
bash: cd: tti: No such file or directory
:->

When tti/* is used


:->find tti/* -exec ls -ltr {} \;
-rw-r--r-- 1 oracle dba 0 Sep 23 11:39 tti/aa.log
total 0
-rw-r--r-- 1 oracle dba 0 Sep 23 11:39 ab.log
-rw-r--r-- 1 oracle dba 0 Sep 23 11:39 tti/tt1/ab.log
:->find tti/* -exec rm -rf {} \;
:->cd tti
:->ls
:->pwd
~/tti

Thursday, September 16, 2010

ISS (internet security systems) IBM

Proventia Management SitProtector Console

client version: 2.8.0.247
server version: 2.8.0.231
http://www.iss.net/support/documentation/docs.php?product=16&family=8

Wednesday, September 8, 2010

comment multiple lines in shell script

how to comment multiple lines in shell script
1.
Wrap the lines within :<< MARKER.. MARKER like shown below

Instead of MARKER you can use any string which is not used in your script. Preferably a unique string.


Code:
:<< COMMENT
a line in the script.
another line in the script
.
.
yet another line in script.
COMMENT
The above is the easiest thing to do.

2.
Else within vi you could issue


Code:
:10,20s/^/#/g

unix command TOP

top
c #full command line
n ## #disply ## process
s 20 # scan every 20 second

The default scan rate on top is 10 seconds. What this means is that with enough top sessions, and we ALL put them on , top itself starts to interfere with the machine. If you start top then type in “s 20” (only without the double quotes), you can change the scan rate to every 20 seconds. 30 would be even better.

If you type “c”, you should get a wider description of the commands. That will definitely help when every command displays as “oracle”. If this option does not work on some particular machine, please let me know and I will get it fixed.

And finally, if you type “n ##” where ## is some number, you will get that many top processes displayed instead of the default of 10.