Solved

Linux command line syntax copy/zip

Posted on 2008-10-16
5
1,444 Views
Last Modified: 2013-12-16
how do I create a zip file of my httpdocs directory and save permission and directory structure?
0
Comment
Question by:pda4me
  • 3
5 Comments
 
LVL 9

Expert Comment

by:michofreiha
ID: 22729870
to zip a file on linux make the following:

gzip -c file_name

What do you mean by save permission and directory structure???
0
 

Author Comment

by:pda4me
ID: 22729884
sorry, I want to zip up my /httpdocs directory to a single file so that I can download it as a backup.
0
 
LVL 9

Expert Comment

by:michofreiha
ID: 22729914
tar -cvzpf filename.tar.gz /path/to/folder
0
 
LVL 9

Accepted Solution

by:
michofreiha earned 500 total points
ID: 22729921
tar -cvzpf filename.tar.gz /path/to/httpdocs
0
 
LVL 48

Expert Comment

by:Tintin
ID: 22735415
Given your question asked for zip, you do

zip -r  backup.zip /path/to/httpddocs
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question