Wget and correct zip for command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Wget and correct zip for command
# 1  
Old 06-05-2015
Wget and correct zip for command

If there were 3 files put in a folder on /Desktop/Test then transferred to a site.

would

Code:
 gzip -r /Desktop/Test

zip them so that

Code:
 wget --http-user cmccabe --http -passwd xxxx*** https://something.sharefile.com/login.aspx -O - | tar -zxf -

could be used to connect to the site, login, download and extract the file.

Thank you Smilie.
# 2  
Old 06-05-2015
gzip doesn't resemble zip in being an archive that holds multiple files. To create a tar file, you use tar. gzip is involved, but if you un-gzip it, all you get is a tar file, so might as well let tar do everything.
Code:
tar -zcf /path/to/file.tar.gz -C /Desktop/test .

I also strongly suspect you can't just blithely use wget on sharefile.com without doing some login things first. --http-user and -passwd are for HTTP basic authentication, which is not the same as the web login forms you find these days.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 06-05-2015
Thanks, I will have to research more on the login to sharefile. Thank you Smilie.

---------- Post updated at 02:42 PM ---------- Previous update was at 01:07 PM ----------

Maybe:

Code:
wget --user=username --password --secure-protocol=protocol (talking to IT to figure out if it is auto, SSLv2, SSLv3, or TLSv1) https://something.sharefile.com/login.aspx -O - | tar -zxf -

Thank you Smilie.
# 4  
Old 06-05-2015
wget's user and passwd are for HTTP basic authentication, which is not the same as the web login forms you find these days. How to use those depends entirely on the webpage and depending on the implementation may involve cookies and javascript.
# 5  
Old 06-05-2015
It may be easier to unzip the files locally after I download them manually, but I will keep looking.

Code:
 tar -zcf /path/to/file.tar.gz -C /Desktop/test .

compressed and put in sharefile

folder downloaded to local machine

Code:
 tar xf test.tar.gz -C /home/Desktop/Files/

used to extract to folder on desktop. Thank you Smilie.
# 6  
Old 06-05-2015
Should be tar -zxf test.tar.gz though GNU tar will detect those errors and correct them for you.
This User Gave Thanks to Corona688 For This Post:
# 7  
Old 06-05-2015
Thank you Smilie.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Id command does not return correct username

On server1 the "id" command works fine and returns "myuser" user as was expected. Below are the details of the good server. $ id -nu 501 myuser $ cat /etc/system-release Red Hat Enterprise Linux Server release 7.6 (Maipo) $ uname -a Linux server1 3.10.0-957.el7.x86_64 #1 SMP Thu Oct 4... (10 Replies)
Discussion started by: mohtashims
10 Replies

2. Shell Programming and Scripting

How to auto correct a failing command?

If a command is not found, e.g. nawk, this is how I fix the problem ] && NAWK=/usr/bin/gawk ] && NAWK=/usr/bin/nawk ] && NAWK=/usr/bin/awkI use $NAWK an the set the appropriate value based on the system it runs. How can I implement a similar fix for a command found but illegal argument.... (6 Replies)
Discussion started by: mohtashims
6 Replies

3. Shell Programming and Scripting

Wget command help

hi, i need help for downloading excel file from internet and convert it to text file wget http://spreadsheetpage.com/downloads/xl/wordfrequency.xls (4 Replies)
Discussion started by: raghur77
4 Replies

4. UNIX for Advanced & Expert Users

I was trying this command...am I going correct? other there is better way

I was trying to copy all debs from apt cache to some storage location and I was taking this approach... /var/cache/apt/archives# ls -1 | grep -v jdownloader | fgrep .deb | xargs cp /media/eshant/L-STORE/Softwares/openjdk/an error bla_bla.deb is a not directory stalled me Suggestions please... (9 Replies)
Discussion started by: ezee
9 Replies

5. UNIX for Dummies Questions & Answers

best way of using wget command?

Dear all, I would like to use the wget command to download on my laptop some free e-books for then being able to read them when I am off the internet. could you please let me know, what is the best of doing that? Let's say, I want download the bible that can be found here: The Project... (3 Replies)
Discussion started by: freddie50
3 Replies

6. UNIX for Dummies Questions & Answers

Binding command in wget.

I was recently reading a manual of wget and there was command as "binding-address" and I read about tcp/ip binding but i don't understand one thing is...what is the use of binding address in wget.. Can anyone help me with this. (6 Replies)
Discussion started by: jFreak619
6 Replies

7. Solaris

2 questions regarding the WGET command

I'm using the "wget" command to get the date from Yahoo.com. So this is what I use on Solaris: /usr/sfw/bin/wget --timeout=3 -S Yahoo! This works well when my computer is linked to the Net. But when it's not, this command just hangs. I thought putting the timemout = 3 will make this... (2 Replies)
Discussion started by: newbie09
2 Replies

8. UNIX for Dummies Questions & Answers

Zip command (zip folder doesn't include a folder of the same name)

Hi guys, I have a question about the zip command. Right now I have a directory with some files and folders on it that I want to compress. When I run the zip command: zip foo -r I am getting a foo.zip file that once I unzip it contains a foo folder. I want to create the foo.zip, but that... (1 Reply)
Discussion started by: elioncho
1 Replies

9. UNIX for Dummies Questions & Answers

Is this grep command correct?

Hi I need to know if I have got the following grep command correct. I wanted to find from myfile.txt all signed real numbers (e.g. +5.0, -78, but not 5.0, 5 are not). I have thought about it and decided it was this: grep '' myfile.txt but I was wondering if this was correct. If... (2 Replies)
Discussion started by: rushhour
2 Replies

10. Shell Programming and Scripting

wget command

hi I was run thix command(wget) it was runing in some severs but in some servers it wasn't run ?? ...... how to it run in that server ? thx :( (1 Reply)
Discussion started by: XPS
1 Replies
Login or Register to Ask a Question