Thursday 27 January 2011

How to remove ^M from VI editor ?

Hellos


To remove this, open your file in vi editor and type
:%s/(ctrl-v)(ctrl-m)//g

OR

:%s/^M//g


Here %s is search and replace command in VI
^M is need to replace
Enter text between // which you want there
and 
finally g is using for all occurrences.




Cheers!

Friday 21 January 2011

How to run php commands in command line on ubuntu?

Use the following example to run php command in command line:

$ php -a
php > echo 'aswani kumar';
ashwani kumar
php >


Cheers!

Friday 7 January 2011

How to copy files/folder in ubuntu/putty?

Hi

Suppose you have a folder which name is ashwani & it contains some content and now you want to create new folder name kumar with same content.

So

source = ashwani
destination = kumar

cp -r <source> <destination>

Note: -r is being used for subfolder and files.

Cheers!