Recently I had to transfer an entire folder, with lot of sub-folders to an FTP server. I know that there are lot of FTP GUI tools available that can do it, but I wanted to do it in command line so that I can script it.
I searched for the solution and came across an excellent tool called wput, which does exactly that very easily. It is very similar to wget, but instead of downloading the content, it allows you to upload it.
I installed it using apt-get and was trying to upload the entire directory. It was at this point I realized that I want to exclude all the .svn folders.
I again started searching for an answer. I even posted about it in stackoverflow, but couldn’t find a solution. I then went over the man page of wput and hidden inside was this gem, which allowed you decide on which files to include/exclude from the directory.
I thought of posting it here, so that it is useful for others and also I know where to find it when I need it next time.
So all you need is just one line. If you have not installed wput before, the install it using one of the following commands based on your operating system.