Showing posts from December, 2011

Replace String in Unix

To replace all instances of a string in a directory (subdirectories included) do:
Code: perl -e "s/FIND/REPLACE/g;" $(find path/to/DIRECTORY -type f)
The above will make a backup temp file of your original 
If you do not want a temp file with the .save extension then do:

Code: perl -e "s/FIND/REPLACE/g;" -pi $(find path/to/DIRECTORY -type f) --------------------
You want to replace all instances of the word "design" with "dezine" in the directory /public_html/company/info

you can execute the command from document root as 
Code: perl -e "s/design/dezine/g;" $(find public_html/company/info -type f) or you can execute the command from public_html/company/ (a directory above) as:
Code: perl -e "s/design/dezine/g;" $(find info -type f) ------------------------------

The above commands will search all files (.gif, .jpg, .htm, .html, .txt) so you might see some error messages "Can't open *.gif", …

Changing Windows Account password using Outlook
1) Call the helpdesk - the most likely scenario if you are not in a hosted environment2) Use the control panel - most Hosted Exchange providers provide a function on a user's control panel enabling the user to change their password, using the functionality in item (3). Most large companies will implement a similar capability for their users. Small companies will likely need to implement item (3) directly or their helpdesk will do it (as in item 1).3) Enable IISADMPWD - use KB 555071 to enable the use of a web page to allow changing the password of an active directory user.