Posts

Showing posts from 2013

Command to search a particular word in multiple files under the parent directory.

To execute this command first go the parent directory then use the following command:- find . -type f -print0 | xargs -0 grep lover /dev/null this will find all the files/lines which includes the word ''lover'' under the parent directory from which the command is executed.

linux command to find and change a value in multi files

linux command to find and change a value in multi files find . -name "*.php" -print | xargs sed -i 's/power/strong/g' here  *.php will search for all files that ends with .php ''power''  is the value to be searched and ''strong'' in the value to be replaced

Linux Command to change the permisson of multiple directories/files having the same name

Command to change directory permission of multi directories with the same name :- find -name 'power' -type d -exec chmod 0777 {} \; here will search for the directories named ‘power’ all directories inside from the parent directory and change the permission to 777. Command to change directory permission of multi directories with the same name :- find -name 'power' -type f -exec chmod 0644 {} \;     here will search for the files named ‘power’ all directories inside from the parent directory and change the permission to 644.

Backup and restore multiple databases using linux command mysqldumb

 Backup and restore database using linux command mysqldumb is the simplest and the easier method.  For taking backup of all databases:-  mysqldump -u root -p --all-databases > dumb.sql  For Restoring the databases:-  mysql -u root -p < dumb.sql Its that easy.

How to open a pem file in Putty

downoload puttygen.exe   open it and browse for the ‘pem’ file, click ‘ok’  . give passphase if needed. click ‘save private key’ give a passphrase for eg:- 123    so that even if anyone start putty with that .ppk file created, they will not be able to enter unless they know the passprase. Or u can leave the passphrase null so that during connection it will ask only the username. Now open Putty.exe  then go the option Connection -> SSH-> Auth -> browse -> select the .ppt file and click open.

External drives connected to Windows 2003 server doesn't show in my computer.

 The issue is because the server is not enabled the automount option.  Inorder to resolvethe issue, open command promt and type the following:-   C:\>diskpart diskpart>automount -tell us if automount is enabled diskpart>automount enable -enable automatic drive letter assignment diskpart>automount scrub -remove old automatic drive letter assignments diskpart>exit C:\>exit   Now connect the new external USB/HDD to the server and it will be showing  in the 'My computer'. Have a nice day.