0
votes
2answers
51 views

Find an archive and extract it in the directory where it is located

I want to find a tar file which is presented in any directory and un-archive it in a one line command. I am able to find it separately from home directory. but only can extract it from directory ...
0
votes
1answer
40 views

Store restored files and directories in a separate directory

I have backup files in the form backup-date.tar and these files will be in a directory called backup. I am performing a restore by using tar -xvf backup-date.tar but the restored file is placed in the ...
0
votes
4answers
433 views

Why does this shell script fail in bash, but the commands work in SSH?

I'll first admit to being quite the noob in Linux/SSH/etc. What I'm trying to write is a shell script that will back up a website and all the MySQL DBs that support it. I found examples all over the ...
1
vote
2answers
96 views

tar specific files based on a pattern

I got a lot of files with the following format: 2014_04_01_11.txt 2014_04_01_12.txt 2014_04_01_13.txt 2013_03_25_12.txt 2013_04_29_15.txt I would like to tar all theses files into an archive 20?? _ ...
1
vote
1answer
134 views

`tar` with `find` with removing original file extension

I want to create tb2 files from bunch of text files like this. tar cfj $(basename ./2014_04_09.txt .txt).tb2 $(basename ./2014_04_09.txt) With this command I can create a archive file 2014_04_09.tb2 ...
1
vote
3answers
137 views

Taking Backup of files of particular limit in unix

Here is the scenario, I have 1000 files in a folder each ~3 MB. I want to zip all files into 50MB each zip and remove the original files. NOTE: 50MB may contain 20 files or 10 files but that zip ...
0
votes
2answers
111 views

find command and tar

find /informatica/dev/SrcFiles* -mtime +7 -and -size +1M -exec tar -cvjf> So I ran this command and I can't find the file after it was done running (probably because I never named it?). The ...
5
votes
2answers
1k views

How to download an archive and extract it without saving the archive to disk?

I'd like to download, and extract an archive under a given directory. Here is how I've been doing it so far: wget http://downloads.mysql.com/source/dbt2-0.37.50.3.tar.gz tar zxf dbt2-0.37.50.3.tar.gz ...
5
votes
3answers
645 views

Tar piped to split piped to scp

So I'm trying to transfer a bunch of files via SCP. Some of these are too large to be stored on the recipient (Android phone, 4GB file size limit). The sender is almost out of space, so I can't ...
3
votes
2answers
8k views

Compress old log file into single zip-linux

I have a folder /home/testuser/log which contain log files of one day old *.log. I wish to compress all the log files older than one day to a single zip(gzip or tar.gz) and delete the older files. I ...
1
vote
2answers
5k views

tar: Unexpected EOF in archive

I am trying extract .tar.gz file it but with no luck gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now the ...
3
votes
1answer
418 views

Extract directory from wget's stdout

I am trying to wget a tarball from github.com and, without creating a temporary file, extract a subdirectory from it: wget -qO- https://github.com/django-nonrel/django-nonrel/tarball/develop | tar ...
19
votes
1answer
21k views

How do you extract a single folder from a large tar.gz archive?

I am using this command on a 5GB archive tar -zxvf archive.tar.gz /folder/in/archive is this the correct way to do this? It seems to be taking forever with no command line output...
4
votes
2answers
1k views

Using files that have spaces in their name in pipes

I have folder named play which contains a file damn file (with space). When I use find and pipe the output to tar: find play/ -name 'damn*' | tar cf archive.tar -T - It works perfectly. Why does ...
8
votes
4answers
4k views

tar extraction depends on filename?

I often download tarballs with wget from sourceforge.net. The downloaded files then are named, e.g ...
0
votes
4answers
2k views

Copy a directory to external HDD

I'm trying to copy a directory to external HDD- i mounted the device and then typed : cd root tar -cf - * | (cd /mnt ; tar -xpf -) I got this error message: "cowardly refusing to create an empty ...
2
votes
3answers
1k views

untar a directory of *.tgz files using a wildcard

I've got a directory that looks like $ ls Broad_hapmap3_r2_Affy6_cels_excluded.tgz DINGO.tgz GIGAS.tgz index.html IONIC.tgz passing_cels_sample_map.txt ...