Unix / Linux

Tuesday, February 28, 2006

Setting your shell to print the whole directory path

simply type this in your shell:

PS1="[\s-\u@\h \w]\\$ "

details about the meaning of the letters can be found at: http://www.comptechdoc.org/os/linux/tips/tipsps1.html

Recursivly zip a directory

zip -r zipname.zip directory_to_zip

Mastering VI - Tutorial

http://www.eng.hawaii.edu/Tutor/vi.html#s-mvcur

Monday, February 27, 2006

scp transfer files securly between machines just like with cp

local to remote:

scp /local/path/local-file user@remote-computer:/remote/path/remote-file


remote to local:

scp user@remote-computer:/remote/path/remote-file /local/path/local-file

Thursday, February 23, 2006

Install tcpflow on solaris - log history

325 cd /etc/
326 vi /etc/inet/ntp.conf
327 ls -al
328 cd /etc/inet
329 ls -al
330 scp ntp.conf root@x.x.x.x:/etc/inet
331 ps -ef
332 exit
333 cd /etc/inet
334 vi ntp.conf
335 ssh -l root x.x.x.x
336 cd /var/spool/pkg/
337 ls -al
338 pkgadd -d tcpflow-0.12-sol8-sparc-local
339 /usr/local/bin/tcpflow
340 ssh -l root x.x.x.x
341 exit
342 tcpflow
343 pwd
344 ifconfig
345 ifconfig -a

Wednesday, February 22, 2006

Find a file containing text

find . -type f -name "*" -exec grep -i put_some_text_here {} \; -print

Tuesday, February 21, 2006

softlink: ln -s

Example:

ln -s /usr/local/j2sdk1.4.2_05 /usr/local/java

The OS will treat /usr/local/java as if its /usr/local/j2sdk1.4.2_05

(working with full path's gave me better results)