This blog is to keep my Unix commands which I often use it in my weblogic environment.
http://www.eng.hawaii.edu/Tutor/vi.html
Vi Editor:
———
:q –> to quit
:q! –> quit without save
:w –> save
:wq –> save and quite
:w filename2 –> Save as filename2
? –> backward search
/ —> forward search
G –> Go to End of the file
:<line#> –> to go to specific line
Setting Path
————
PATH=$PATH:/usr/java/j2sdk1.4.2/bin
export PATH
bash-3.00$ JAVA_HOME=/usr/java5_64/bin
bash-3.00$ export PATH=$JAVA_HOME:$JAVA_HOME/bin:$PATH
bash-3.00$ java -version
PS command
———-
http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/
bash-2.05b$ pgrep -U schellap java
pgrep -U schellap java
Set Classpath
————-
bash-3.00$ CLASSPATH=/u01/CR-root/Arun/wls923/weblogic92/server/lib/weblogic.jar
bash-3.00$ export CLASSPATH
create a file
————-
cat filename
rm unwantedfile
rm -r directoryname –> to remove a directory
[slcruser@sllinux8 schellap]$ cat > examplesServer.log00004
919943629191
francis.rajamohan@sbcglobel.net
——>
mv –> move
to un tar –> tar xvf ./logs_030410.tar
to unjar .Z file –> uncompress ./aims_srv_01.log.Z
http://kb.iu.edu/data/acsy.html
grep:
[oracle@linas1 aixblhspa01_sunone]$ grep rLRDLQRQgQR8Yjh7vhGDf43RcH1WpW1Bn1TqjL2vjqwGwW8cTf0y wlproxy.log | wc -l
grep “string” filename | more
zcat *sass.Z|grep “machan”
grep “string” filename | grep -v “exclude” filename
grep -c “Error” logfile.txt –> to count the # of occurences
http://javarevisited.blogspot.com/2011/06/10-examples-of-grep-command-in-unix-and.html#.Th8-hGFtNpg
grep –context=6 successful logfile.txt
grep -C 2 ‘hello’ *
egrep ‘Error|Exception’ logfile.txt
grep -i Error logfile –> case in sensitive
zgrep -i Error *.gz
grep -w ERROR logfile
grep ‘ERROR>’ *
ps command
———-
http://lowfatlinux.com/linux-gzip-gunzip.html
sar –> http://en.wikipedia.org/wiki/Sar_in_UNIX –> System Activiy Reporter
mpstat –> Report per-processor or per-processor-set-statiscs
—> install wls
$ chmod +x wls1036_linux64.bin
$ ./wls1036_linux64.bin
–> zip
to compress:
zip squash.zip file1 file2 file3
to uncompress:
unzip squash.zip
–> gz
gunzip file.gz
$ gzip -d file.gz
— Unix search commads
./find . -name “foo.txt” -print
— start Weblogic where save all the System.out
. ./startWebLogic.sh 2>&1 | tee -a out.log