Total, Over 6 years of extensive experience in SCM domain having depth knowledge of Configuration Management, Build Management, Packaging, Release Management and Application Maintenance.

Pages home > My Shell Script collection

My Shell Script collection

Shell scripts to convert file names to lower case and upper case
To convert to lower case:
#!/bin/sh
for i in *
do
j=`echo $i | tr '[A-Z]' '[a-z]'`
mv $i $j
done

To convert to upper case:
#!/bin/sh
for i in *
do
j=`echo $i | tr '[a-z]' '[A-Z]'`
mv $i $j
done

Searching for a String in Multiple Files

grep -r "modules" .
grep -lr "modules" .
grep -lr "mod.*" .
grep -r "drupal\|joomla\|wordpress" .
grep -lr "mod.*" ./log*

Search for files in your home directory which have been modified in the last twenty-four hours. This command works this way because the time since each file was last modified is divided by 24 hours and any remainder is discarded. That means that to match -mtime 0, a file will have to have a modification in the past which is less than 24 hours ago.

find . -mtime 0

 

For more examples, please refer following...

http://www.scmgalaxy.com/forum/shell-script/

, ,

build tools, scripting

Last updated 138 days ago by Rajesh Kumar