File Rename By File Extension
for file in *htm ; do mv $file `basename $file htm`html; done”
A chronological documentation test project, nothing serious, really!
for file in *htm ; do mv $file `basename $file htm`html; done”
If you have shell access to your webserver this script can be used to upgrade your WordPress installation to the latest version quickly. Always remeber to backup your database and installation files before running it! Do change the bold text to reflect your WordPress Internet address before you run the script. #!/bin/bash CURDIR=$(pwd) SITE=”http://yoursite.com/wordpress” echo […]
This is a simple oneliner to replace words inline using perl :) # for i in `find ./ -name foo` ; { perl -p -i -e “s/oldword/newword/g” $i ;} You’ll need bash and perl.
#!/bin/bash # Shell script to backup MySql database # To backup Nysql databases file to /backup dir and later pick up by your # script. You can skip few databases from backup too. MyUSER=”SET-MYSQL-USER-NAME” # USERNAME MyPASS=”SET-PASSWORD” # PASSWORD MyHOST=”localhost” # Hostname # Linux bin paths, change this if it can’t be autodetected via which […]
To get expiration date use grep command: $ whois nixcraft.com | egrep -i ‘Expiration|Expires on’ Output: Expiration Date: 10-may-2009 NOTICE: The expiration date displayed in this record is the date the currently set to expire. This date does not necessarily reflect the expiration view the registrar’s reported date of expiration for this registration. Expires on: […]