Posted on September 27, 2014, 9:19 pm
I am not new to linux but i am not friendly with linux :D, within my new mission i work every day with black and white terminal screen so command line every day.
How beautiful linux is !!
Soon i might become a shell script developer ^^ or this is another challenge !! but you know i'am already fall in love with JAVA :)
Today i share with you some useful linux command :
netstat -ap | grep :PortNumber
kill -9 PortNumber
By using VI/VIM i can easily read a 2GB text file :) really appreciated about that and feel sorry for notepad/notepad++ :(
+ Save : Ctrl + c then type :wq then type Enter
+ Close without save : Ctr + c then type :q!
+ Find : Ctr + c then type / and the word that you want to find
if the word contain space then use quote between the word
+ Show line number : Ctrl + c then type :set nu
+ hide line number : Ctrl + c then type :set nu!
+ hide syntax hilighting : Ctr + c then type :syntax off
+ Show syntax hilighting : Ctr + c then type :syntax on
ls | wc
Suppose that you're on your local machine, and you can access to other machine.
To copy the file form the other machine use the command line below.
scp -p ${user}@${domain}:${source} ${target}
ex : scp -p abcd@0.0.0.1:/var/wwww/html/my_import_file.zip /var/pgsql
echo $(date "+%Y%m")$(($(date "+%d")-1))
/!\ add slash befor the % if you put this in crontab Ex: $(date "+\%Y\%m")$(($(date "+\%d")-1))
psql -U user_name -d database_name -a -f /var/pgsql/my_import_file.sql
sqlplus /nolog
connect username/password@oracle_machine_name
Or
sqlplus /nolog
connect username/password@(description=(address=(protocol=TCP)(host=xxx)(port=xxx))(connect_data=(sid=xxx)))