Sponsored Content
Top Forums Shell Programming and Scripting Download and extract to a specific directory Post 302978562 by cmccabe on Monday 1st of August 2016 09:40:11 AM
Old 08-01-2016
Download and extract to a specific directory

Trying to download and extract a file to a specific folder, but getting an error. What am I doing wrong? Is there a way to rename the download if desired? Thank you Smilie.

Code:
curl --url https://github.com/arq5x/bedtools2/releases/download/v2.26.0/bedtools-2.26.0.tar.gz | tar -xz --output /home/cmccabe/test
tar: unrecognized option '--output'
Try 'tar --help' or 'tar --usage' for more information.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   598    0   598    0     0   2939      0 --:--:-- --:--:-- --:--:--  2945
(23) Failed writing body

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to download and extract files on Linux machine from internet

Hi, I am working on Linux 64 bit machine. I am trying to install one software on Linux machine. I downloaded that software from internet on my windows machine. Now in order to install software on Linux machine, I will need all downloaded files on Linux machine. How can I do that? So my... (3 Replies)
Discussion started by: palak08
3 Replies

2. UNIX for Advanced & Expert Users

allow user to use sudo cp on a specific directory and only a specific file

Is there a way to allow a user to use sudo cp on a specific directory and only a specific file? (6 Replies)
Discussion started by: cokedude
6 Replies

3. Solaris

HOW TO extract.tar file to specific directory..?

Hi all, In Solaris howto extract tar file to specific folder. This is what we do in Linux, but how to do the same thing in Solaris ? -tar -xzvf /tmp/etc.tar.bz -C /tmp (Will extract in /tmp dir) 3.gzip COMPRESSION AND EXTRACTION -tar -czvf /tmp/etc.tar.bz /etc -du ... (5 Replies)
Discussion started by: manalisharmabe
5 Replies

4. Shell Programming and Scripting

Curl download zip extract large xml file

Hi i have a php script that works 100% however i don't want this to run on php because of server limits etc. Ideally if i could convert this simple php script to a shell script i can set it up to run on a cron. My mac server has curl on it. So i am assuming i should be using this to download the... (3 Replies)
Discussion started by: timgolding
3 Replies

5. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies

6. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies

7. Shell Programming and Scripting

Bash to download specific files and save in two folders

I am trying to download all files from a user authentication, password protected https site, with a particular extension (.bam). The files are ~20GB each and I am not sure if the below is the best way to do it. I am also not sure how to direct the downloaded files to a folder as well as external... (7 Replies)
Discussion started by: cmccabe
7 Replies

8. Shell Programming and Scripting

Bash to tell download where specific files are stored

The bash below will download all the files in download to /home/Desktop/folder. That works great, but within /home/Desktop/folder there are several folders bam, other, and vcf, is there a way to specify by extention in the download file where to download it to? For example, all .pdf and .zip... (2 Replies)
Discussion started by: cmccabe
2 Replies

9. Programming

Aria2c to download and extract. tar.bz2

I am using aria2c to download a .tar.bz2 and trying to extract it in the same command. I can download the file but not extract it. I can also manually extract the tar.bz2., but not in the same command. Thank you :). aria2c -x8 -l log.txt -c -d /xx/xx/xxx --use-head=true --http-user "<user>" ... (8 Replies)
Discussion started by: cmccabe
8 Replies

10. Shell Programming and Scripting

awk to create link, download, and extract in sub-directory

The awk below will create sub-directories in a directory (which is always the last line of file1, each block separated by an empty line), if the number in line 2 (always the first 6 digits in the format xx-xxxx) of file2 is found in $2 of file1. This is the current awk output. If there is a... (0 Replies)
Discussion started by: cmccabe
0 Replies
virt-tar(1)						      Virtualization Support						       virt-tar(1)

NAME
virt-tar - Extract or upload files to a virtual machine SYNOPSIS
virt-tar [--options] -x domname directory tarball virt-tar [--options] -u domname tarball directory virt-tar [--options] disk.img [disk.img ...] -x directory tarball virt-tar [--options] disk.img [disk.img ...] -u tarball directory OBSOLETE
This tool is obsolete. Use virt-copy-in(1), virt-copy-out(1), virt-tar-in(1), virt-tar-out(1) as replacements. EXAMPLES
Download "/home" from the VM into a local tarball: virt-tar -x domname /home home.tar virt-tar -zx domname /home home.tar.gz Upload a local tarball and unpack it inside "/tmp" in the VM: virt-tar -u domname uploadstuff.tar /tmp virt-tar -zu domname uploadstuff.tar.gz /tmp WARNING
You must not use "virt-tar" with the -u option (upload) on live virtual machines. If you do this, you risk disk corruption in the VM. "virt-tar" tries to stop you from doing this, but doesn't catch all cases. You can use -x (extract) on live virtual machines, but you might get inconsistent results or errors if there is filesystem activity inside the VM. If the live VM is synched and quiescent, then "virt-tar" will usually work, but the only way to guarantee consistent results is if the virtual machine is shut down. DESCRIPTION
"virt-tar" is a general purpose archive tool for downloading and uploading parts of a guest filesystem. There are many possibilities: making backups, uploading data files, snooping on guest activity, fixing or customizing guests, etc. If you want to just view a single file, use virt-cat(1). If you just want to edit a single file, use virt-edit(1). For more complex cases you should look at the guestfish(1) tool. There are two modes of operation: -x (eXtract) downloads a directory and its contents (recursively) from the virtual machine into a local tarball. -u uploads from a local tarball, unpacking it into a directory inside the virtual machine. You cannot use these two options together. In addition, you may need to use the -z (gZip) option to enable compression. When uploading, you have to specify -z if the upload file is compressed because virt-tar won't detect this on its own. "virt-tar" can only handle tar (optionally gzipped) format tarballs. For example it cannot do PKZip files or bzip2 compression. If you want that then you'll have to rebuild the tarballs yourself. (This is a limitation of the libguestfs(3) API). OPTIONS
--help Display brief help. --version Display version number and exit. -c URI --connect URI If using libvirt, connect to the given URI. If omitted, then we connect to the default libvirt hypervisor. If you specify guest block devices directly, then libvirt is not used at all. --format raw Specify the format of disk images given on the command line. If this is omitted then the format is autodetected from the content of the disk image. If disk images are requested from libvirt, then this program asks libvirt for this information. In this case, the value of the format parameter is ignored. If working with untrusted raw-format guest disk images, you should ensure the format is always specified. -x --extract --download -u --upload Use -x to extract (download) a directory from a virtual machine to a local tarball. Use -u to upload and unpack from a local tarball into a virtual machine. Please read the "WARNING" section above before using this option. You must specify exactly one of these options. -z --gzip Specify that the input or output tarball is gzip-compressed. SHELL QUOTING
Libvirt guest names can contain arbitrary characters, some of which have meaning to the shell such as "#" and space. You may need to quote or escape these characters on the command line. See the shell manual page sh(1) for details. SEE ALSO
guestfs(3), guestfish(1), virt-cat(1), virt-edit(1), virt-copy-in(1), virt-copy-out(1), virt-tar-in(1), virt-tar-out(1), Sys::Guestfs(3), Sys::Guestfs::Lib(3), Sys::Virt(3), <http://libguestfs.org/>. AUTHOR
Richard W.M. Jones <http://people.redhat.com/~rjones/> COPYRIGHT
Copyright (C) 2009 Red Hat Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. libguestfs-1.18.1 2013-12-07 virt-tar(1)
All times are GMT -4. The time now is 04:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy