find . -type f -exec perl -pi -e ’s|\cM||’ {} \;
fc -l 10|head -5
(two str around)cat scrollbar|sed -n -e "/La/{=;x;1!p;g;$!N;p;D;}" -e h
cat scrollbar| sed 3,8!d  (equal sed -n 60,100p)
(reverse;)) cat scrollbar| sed "/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//"
(usfriendly man)man kill|sed "s/.`echo \\\b`//g"
(sum_allpl)find . -name "*.pl" -exec ls -l {}  \;|awk '{sum += $5}; 
END {printf("%ld\n", sum)}'  2>/dev/null
< Leader > == \ (backslash) - it is none in google

#regular operation

####################
# clearenv
####################
setBatchState STOP_EMMEDIATE
ora
sqlplus /nolog @clearenv upt
####################
# last version clearenv
####################
 sqlplus /nolog @clearenv.sql icttr1o icttr1o icttr1b icttr1b
####################
bin
S999ict stop_online
S999ict stop_bcd
S999ict summary
S999ict start_online
S999ict start_bcd

#######################################
#change value in file with perl !!!
#######################################
perl -pi -e "s/20031203/20031201/g" test_20031201.intec
#use variable
fls=`ls -l|grep "Jan 14"|head -n 10|awk  '{print $9}'|xargs`
######antar

 To extract files from the archive:

     example% tar xvf /dev/rmt/0
     messages from tar

####################
# move finded files
####################
find . -name "*.bz2"  -exec mv {} /edb4tel/march \; 2>/dev/null

find . -name "*.bz2"  -exec mv {} ./new_bz2 \; 2>/dev/null
find . -mtime 2|wc -l

ls -l|grep Feb|grep .pl|awk  '{print $9}'|xargs  -exec rm {} \; 2>/dev/null
#delete Feb files

icsprod:{PRD}/bmd/processed# ls |wc -l
   24116
icsprod:{PRD}/bmd/processed# ls -l|grep Jul|wc -l
    8554



     For example, to compare each C header file in the current
     directory with the file `/tmp/master':

          find . -name '*.h' -exec diff -u '{}' /tmp/master ';'

#files 2 days ago
cat 17.intec|awk '{print $9}'|xargs > xar
tar cvf 17.tar `cat xar`
ls *.intec|xargs|tar cvfu proc.tar
rnu
####################
# select table like
####################

 select  TABLE_NAME from user_tables where TABLE_NAME like '%STORED_CDR_2002_12%';

####################
# number proceccors
####################

/usr/sbin/psrinfo -v |grep 900|wc -l

####################
# replace across the file
####################

find . -type f -name testf |xargs perl -pi -e "s/virta/birta/g"

 ls -l $tr_d/udump |grep "`date +'%b'`" | head -n 3

####################
# sql statements
####################

#duplicate
select count(*) from (select   A_NUMBER, B_NUMBER, CALL_START_TIME, CALL_DURATION, COUNT(*)
from     STORED_CDR_2003_01_01_1
group by A_NUMBER, B_NUMBER, CALL_START_TIME, CALL_DURATION
having   count(*) > 1)
#rownum
SELECT AUDIT_LOG.ENTITY_NAME, AUDIT_LOG.TIMESTAMP, AUDIT_LOG.USERID,
 AUDIT_LOG.BEFORE_IMAGE, AUDIT_LOG.AFTER_IMAGE, AUDIT_LOG.SEQUENCE_NUMBER 
FROM AUDIT_LOG 
WHERE ( (AUDIT_LOG.USERID = 'AALEKSEE') and rownum <2 )

#check space
  df -k|grep rbs|nawk '{if (substr($5,1,2) > 96) print "warn"}'
#mail sms work
echo  "echo"|mailx 79032659084@sms.beemail.ru
#crontab -e (open vi)
5 * * * * echo "chas stoparya nakachu" |mailx -s "sTop" nmishin@beeline.ru
(run command line every 5 minutes)
primer formata comandui date:
####################
echo "`date +'%a_%b_%c_%d_+%e_%g_%h_%j_%k_%l_%m_%n_%p_%r_%t_%u_%w_%x_%y'`"
Thu_Aug_Thu Aug 28 15:41:59 2003_28_+28_03_Aug_240_15_ 3_08_
_PM_03:41:59 PM_        _4_4_08/28/03_03
####################
run script in 12:00:00 every day ??
* 0 * * * /product/ict/nmishin/evday.sh |mailx -s "`date +'%e_%h_%y_%r_icsprod_evdayop.log'`" nmishin@beeline.ru 

   The following command will find all `gzip' files in the current
directory and subdirectories, and extract them in place without
destroying the original:

     find . -name '*.gz' -print | sed 's/^\(.*\)[.]gz$/gunzip < "&" > "\1"/' | sh

gunzip prd_250703.dmp.gz

ls -l|grep Aug|awk  '{print $9}'|wc -l

ls -l|grep Aug|awk  '{print $9}'|xargs -i mv {} /edb4tel/march_03/processed
ls -l|grep Jul|awk  '{print $9}'|xargs  -exec rm {} \; 2>/dev/null

setenv jj 'ls -rtl | grep Aug | grep t_*.lr'
 mv jj ./..

SQL> alter user ictogsb identified by ictogsb;

User altered.

SQL> alter user ictogso identified by ictogso;

find . -atime +1 -type f - exec mv {} TMP \; # mv files older then 1 day to dir TMP
find . -name "-F" -exec rm {} \;   # a script error created a file called -F 
find . -exec grep -i "vds admin" {} \;
find . \! -name "*.Z" -exec compress -f {} \;
find . -type f \! -name "*.Z" \! -name ".comment" -print | tee -a /tmp/list
find . -name *.ini
find . -exec chmod 775 {} \;
find . -user xuser1 -exec chown -R user2 {} \;
find . -name ebtcom*
find . -name mkbook
find . -exec grep PW0 {} \;
find . -exec grep -i "pw0" {} \;
man find . -atime +6
find . -atime +6 -exec ll | more
find . -atime +6 -exec ll | more \;
find . -atime +6 -exec ll \;
find . -atime +6 -exec ls \;
find . -atime +30 -exec ls \;
find . -atime +30 -exec ls \; | wc -l
find . -name auth*
find . -exec grep -i plotme10 {};
find . -exec grep -i plotme10 {} \;
find . -ls -exec grep 'PLOT_FORMAT 22' {} \;
find . -print -exec grep 'PLOT_FORMAT 22' {} \;
find . -print -exec grep 'PLOT_FORMAT' {} \;
find . -print -exec grep 'PLOT_FORMAT' {} \;
find ./machbook -exec chown 184 {} \;
find . \! -name '*.Z' -exec compress {} \;
find . \! -name "*.Z" -exec compress -f {} \;
find /raid/03c/ecn -xdev -type f -print
find /raid/03c/ecn -xdev -path -type f -print
find / -name .ssh* -print | tee -a ssh-stuff
find . -name "*font*"
find . -name hpmcad*
find . -name *fnt*
find . -name hp_mcad* -print
find . -grep Pld {} \;
find . -exec grep Pld {} \;
find . -exec grep Pld {} \;
find . -exec grep PENWIDTH {} \; | more
find . -name config.pro
find . -name config.pro
find /raid -type d ".local_sd_customize" -print
find /raid -type d -name ".local_sd_customize" -print
find /raid -type d -name ".local_sd_customize" -ok cp /raid/04d/MCAD-apps/I_Custom/SD_custom/site_sd_customize/user_filer_project_dirs {} \;
find /raid -type d -name ".local_sd_customize" -exec cp /raid/04d/MCAD-apps/I_Custom/SD_custom/site_sd_customize/user_filer_project_dirs {} \;
find . -name xeroxrelease
find . -exec grep xeroxrelease {} \;
find . -name xeroxrelease
find . -name xeroxrelease* -print 2>/dev/null
find . -name "*release*" 2>/dev/null
find / -name "*xerox*" 2>/dev/null
find . -exec grep -i xeroxrelease {} \;
find . -print -exec grep -i xeroxrelease {} \;
find . -print -exec grep -i xeroxrelease {} \; > xeroxrel.lis
find . -exec grep -i xeroxrel {} \;
find . -print -exec grep -i xeroxrel {} \;
find . -print -exec grep -i xeroxrel {} \; | more
find /raid/03c/inwork -xdev -type f -print >> /raid/04d/user_scripts/prt_list.tmp
find . -exec grep '31.53' {} \;
find . -ls -exec grep "31/.53" {} \; > this.lis
find . -print -exec grep "31/.53" {} \; > this.lis
find . -print -exec grep 31.53 {} \; > this.lis
find . -exec grep -i pen {} /;
find . -exec grep -i pen {} \;
find . -print -exec grep -i pen {} \; | more
find . -exec grep -i pen {} \;
find . -atime +6 -exec ll | more \;
find . -atime +6 -exec ll \;
find . -atime +6 -exec ls \;
find . -atime +30 -exec ls \;
find . -atime +30 -exec ls \; | wc -l
find . \! -name '*.Z' -exec compress -f {} \;
find . -name 'cache*' -depth -exec rm {} \;
find . -name 'cache*' -depth -print | tee -a /tmp/cachefiles
find . -name 'cache[0-9][0-9]*' -depth -print | tee -a /tmp/cachefiles
find . -name 'hp_catfile' 'hp_catlock' -depth -print | tee -a /tmp/hp.cats
find . -name 'hp_catfile' -name 'hp_catlock' -depth -print | tee -a /tmp/hp.cats
find . -name 'hp_cat*' -depth -print | tee -a /tmp/hp.cats
find . -name 'hp_cat[fl]*' -depth -print | tee -a /tmp/hp.cats
find /raid -name 'hp_cat[fl]*' -depth -print
find . \! -name '*.Z' -exec compress -f {} \;
find . -name '*' -exec compress -f {} \;
find . -xdev -name "wshp1*" -print
find . -xdev -name "wagoneer*" -print
find . -name "xcmd" -depth -print
find /usr/contrib/src -name "xcmd" -depth -print
find /raid -type d -name ".local_sd_customize" -exec ls {} \; 
find /raid -type d -name ".local_sd_customize" \
   -exec cp /raid/04d/MCAD-apps/I_Custom/SD_custom/site_sd_customize/user_filer_project_dirs {} \;

find ./ -name '*.txt' -print0 | xargs -0 grep -l egal 

Scripts / Linux / Djefer

backup
bash2bat.sh
clean.sh
installJava.sh
mg.sh
m.sh
resetall
updateEmacs.sh
xboard.sh
xgrep
xsl
backup 26 lines
#!/bin/sh
 
 # Here a script that builds a tar gz from my current home and 
 # stores it in another hardisk
 
 file=$(date +%d%m%y).tar.gz
 
 echo -n "Building $file ? (y/n) "
 
 read ok
 
 if [ ! "$ok" = "y" ]; then
 echo "Exit";
 exit 0;
 fi
 
 if ( ! mount | grep "/mnt/disk" ); then
 echo Mounting /mnt/disk...
 su -c "mount -t ext2 /dev/hdc6 /mnt/disk"
 fi
 
 cd
 
 tar czvf $file travail perl emacs bin emacs-lisp web jenetix jee articles automake bash bin cvs .emacs .bash_rc .mozilla
 
 su -c -m 'mv $file /mnt/disk'

bash2bat.sh 14 lines
#!/bin/sh
 
 [ ! -f $1 ] && echo "Bad File $1" && exit 1;
 
 # Convertissor from sh to windows batch as possible...
 
 tr ':' ';' < $1 > $1~
 sed "s/^\([^=]*\)=/set &\2/g" < $1~ > $1~~
 sed "s/^#.*$/REM Generated by bash2bat (Alexandre Brillant)/" < $1~~ >$1~
 sed "s/\$\([0-9]\)/%\1/g" < $1~ > $1~~
 sed "s/\$\([^$ ]*\)/%\1%/g" < $1~~ > ${1%%sh}bat
 rm -f $1~ $1~~
 
 echo Writing ${1%%sh}bat...

clean.sh 18 lines
#!/bin/sh
 
 # Script that kill all element in FILTER from the current directory
 
 FILTER="\*~ \*.*~ \*.*# CVS"
 
 echo -n "Agree for applying $FILTER ? (y/n)"
 read OK
 
 if [ ! "$OK" = "y" ]; then
 echo exit
 exit 0;
 fi
 
 for i in `echo $FILTER`; do
 i=${i##\\}
 find . -name "$i" | xargs rm -rf 
 done

installJava.sh 26 lines
#!/bin/sh
 
 # Script for installing the JDK 
 
 JDK_INSTALL=/usr/java
 
 xargs echo < /tmp/.emacs~
 cp .emacs .emacs~
 cp /tmp/.emacs~ .emacs
 zip -r emacs.zip .emacs .abbrev_defs emacs-lisp >/dev/null
 cp .emacs~ .emacs
 rm .emacs~
 tar czf emacs.tar.gz .emacs .abbrev_defs emacs-lisp >/dev/null
 yes | cp emacs.zip ~/web/site/info/emacs
 yes | cp emacs.tar.gz ~/web/site/info/emacs
 
 echo Transferring by ftp...
 ftp -i -n <   analyze index pkey_cdr_2003_10_18_1 compute statistics;

Index analyzed.

SQL>  SELECT DISTINCT_KEYS FROM USER_INDEXES WHERE INDEX_NAME = 'PKEY_CDR_2003_10_18_1';

DISTINCT_KEYS
-------------
      5980442
a=`ls|wc -l`
      case $a in
	  1)
	  
	  ;;
	  2)
	  
	  ;;3)
	  
	  ;;4)
	  
	      ;;esac

#qryitself | grep "results:" | cut -f2 -d: | read ictstate

#echo "1." $ictstate "message"

#ls /bmd/duplicate |wc -l | read duplicate
#ls /bmd/rejected |wc -l | read rejected

#echo "2 RMAN to oracle DBA"
#echo "3." $duplicate "duplicate"
#echo "  " $rejected "rejected"

#echo "4." "/var/adm/messages log files first 3 lines "
#head -n 3 /var/adm/messages 


#echo "5."  "new trace files"

#tr_d="/u01/oracle/admin/ICT"

#echo "  "  "new trace files in "$tr_d"/bdump"
# ls  $tr_d/bdump |grep "`date +'%b'`" | head -n 3

#echo "  "  "new trace files in "$tr_d"/cdump"
# ls  $tr_d/cdump |grep "`date +'%b'`" | head -n 3

#echo "  "  "new trace files in "$tr_d"/udump"
# ls  $tr_d/udump |grep "`date +'%b'`" | head -n 3

#echo "6."  "Last alert_ICT.log "
#echo "chkalrt.ksh |head -n 5"
#cd /product/ict/6.0.7/SunOS/PRD
#fixdate.ksh
#chkalrt.ksh |head -n 5
#echo "chkalrt.ksh |grep  ORA |head -n 5"
#chkalrt.ksh |grep  ORA |head -n 5
#echo "cat last_chk_date.ini"
#cat last_chk_date.ini
#echo "7."  "free_space"
#echo "monMI.sh"
#cd /product/ict/nmishin
#monMI.sh

stored_segment_2003_11_18_1 network_operator_id ict_restored_index
CREATE INDEX mishin_segm_2003_11_18_1  ON stored_segment_2003_11_18_1(network_operator_id) TABLESPACE ict_restored_index;

cd /bmd/bkup/CPT/
ls *.gz|head -1000|xargs -i gunzip {} && mv *.intec /bmd/tr3/new_input
gzip *.intec
mv *.gz /bmd/bkup/CPT/DONE

/product/ict/nmishin# rename.sh p v *.intec.gz


$ find ~ -name '*' -exec grep -l 'elephant' \{\} \;
  ~/africa/animals.txt