Handy Commands
http://www.pychavan.net/wiki/index.php/Main_Page
http://www.brandonhutchinson.com/cpio_command.html
--------------------------------
awk -F\t {'print$2";"$1"\n"$4";"$3'} |sed -e 's/\[.*]//g'
--------------------------
tar -tvf security\ 1.3.tar.gz -> list content
tar -xvf AAAA.tar -> extract tar archive
gunzip AAAA.cpio.gz veya AAAA.tar.gz -> gz yi kaldırır cpio yada tar lı bırakır
cpio -idv < AAAA.cpio
mkdir -p /mount_point/app/oracle_sw_owner
# chown -R oracle:oinstall /mount_point/app/oracle_sw_owner
# chmod -R 775 /mount_point/app/oracle_sw_owner
find . -name "rc.conf" -print
DISPLAY=159.107.241.109:0.0
export DISPLAY
/usr/openwin/bin/xhost 159.107.241.109
/usr/openwin/bin/xclock
/usr/bin/isainfo -kv -> işletim sistemi kaç bit solaris
unzip -l AAA.zip -> listeler
unzip AAA.zip ->acar
find /opt -name "aranan kelime" -print
When using the rm or unlink command to remove a symbolic link to a directory, make sure you don’t end the target with a ‘/’ character because it will create an error. Example:
$ mkdir dirfoo
$ ln -s dirfoo lnfoo
$ rm lnfoo/
rm cannot remove directory ‘lnfoo/’ : Is a directory
$ unlink lnfoo/
unlink: cannot unlink ‘lnfoo/’: Not a directory
$ unlink lnfoo
$
Notice how one complains it “Is a directory”, but the other complains it is “Not a directory”, which I found confusing. This is a problem if you have a tendency to use tab completion a lot, because it will stick a ‘/’ at the end.
some bash scripting
echo
-e Enable interpretation of the following backslash escaped characters in the strings:
echo -e "An apple a day keeps away \a\t\tdoctor\n"
$ echo "Today is date" replace variable values and print
Can't print message with today's date.
$ echo "Today is `date`". execute command
It will print today's date as, Today is Tue Jan ....,Can you see that the `date` statement uses back quote?
$ echo 'Today is date' => prints unchanged
it will print Today is date
execution status 0 is ok
echo $?
$# holds number of arguments specified on command line. And $* or $@ refer to all arguments passed to script.