bashupload is a place to upload files from command line or other devices and download them elsewhere during 7 days. Upload files now.

How to upload a directory

In order to upload a directory to a server (or other device), you have to pack/compress it first. Complete command to upload "/var/www/dir" directory is here:

tar -czvf /tmp/dir.tgz /var/www/dir && curl --data-binary @/tmp/dir.tgz

Don't forget to remove "/tmp/dir.tgz" file. After upload is done, download and unpack it:

wget && tar -xvf dir.tgz

By default, tar will pack all dir components based on current dir, in order to change that use "C" option. For example, to make tar archive relative to "/var/www" folder:

tar -C /var/www -czvf /tmp/dir.tgz dir && curl --data-binary @/tmp/dir.tgz

More articles