Challenges that each developer faces every day: May 2008

Thursday, May 29, 2008

Linux Date command: Show current date YYYY-DD-MM

YYYY-MM-DD

echo `date +"%Y-%m-%d"`

Result:
2008-05-29

YYYY-MM-DD_HH_MM_SS
echo `date +"%Y-%m-%d_%H-%M-%S"`

Result:
2008-05-29_10-35-44
You can use these for creating files names of backups.


 Digg  Del.icio.us  Reddit  SlashDot

Set/change/export editor variable under linux/unix

This will append export command in your user's .bashrc file.

echo "export EDITOR=vi" >> ~/.bashrc

 Digg  Del.icio.us  Reddit  SlashDot

Friday, May 2, 2008

tar skip svn directories/folders example

tar zcvf backup/project1-2008-05-02/project1.tgz --exclude=.svn project1/

 Digg  Del.icio.us  Reddit  SlashDot