Posts Tagged ‘command-line’

size of linux folder

Thursday, December 10th, 2009

Another quick post here.  I can never remember the command for getting the size of a folder in linux.  A quick search brought me here.  Patched together a few commands and it goes like this:

~ du -sh /path/to/dir

Till Next Time

PS- isn’t it interesting that all my quick posts are about linux commands…

quickie bash cmd to copy all files except a single given file

Friday, March 13th, 2009

In working on my new prod server I only have write access to the symfony folder and www folder.  This isn’t a big deal in actual development, just in backing up my files.  I have become a zealot when it comes to backing up.  Not just backing up files, but keeping a log of where the development stands for each backup.

For instance, before I launch the backend application in symfony, I do a backup and then I do another backup right after I launch it, before I make any modifications.  This seems to help me when I mess something up so bad that I cannot recover from my mistakes.

Since I only have access to the two folders that I am going to be backing up, I don’t want to backup the already backed up files, I would start to take up an exponential amount of space for each backup.  Did a quick google and found the solution here.

cp -r `ls --ignore=file1` destinationDir

Simple and it works. :-)

Till Next Time