Zip all files in a directory?

Joined
Jun 19, 2014
Messages
26
Best answers
0
Ratings
2
Points
3
#1
I am learning Linux and purchased a small vps 1GB of RAM to install hosting software on it. I uploaded many files and folders to my host, I heard that ssh can allow me to zip all files in a directory? how can i do that and how to download my zipped file to my pc?

Your help would be appreciated!
 
Joined
Jun 17, 2017
Messages
45
Best answers
0
Ratings
2
Points
0
#2
For example you want to zip all files in a folder named : cyberpersons


You can use this command,

zip -r cyberpersons.zip cyberpersons

Now your zip file will be present in the current directory, please note that your current directory should not be "cyberpersons" while creating a zip file.

After the zip file is created, you can use WinSCP or FileZilla to connect to your vps and download it to your computer.
 
Joined
Jun 19, 2014
Messages
26
Best answers
0
Ratings
2
Points
3
#3
zip -r cyberpersons.zip cyberpersons
I ran this command on public_html folder and saw zip file there.

After the zip file is created, you can use WinSCP or FileZilla to connect to your vps and download it to your computer.
and downloaded zip file to my computer but when I opened it, I don't see .htaccess file in the zip package, seem it ignored hidden files or .htaccess fle. How to be sure I will zip all files in a folder without missing any files or folder.
 

vpsrus

Well-known member
Joined
Jan 17, 2017
Messages
92
Best answers
0
Ratings
13
Points
0
#5
zip yourfilename.zip directory/* .*

this will zip the hidden files too
 
Newer Threads
Replies
1
Views
1,372
Replies
6
Views
637
Recommended Threads
Similar Threads

Latest Hosting OffersNew Reviews

Web Hosting

Most Likes - Past 30 Days