shortcut for tar cvf - [filename] | gzip > [filename].tar.gz


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers shortcut for tar cvf - [filename] | gzip > [filename].tar.gz
# 1  
Old 12-11-2007
shortcut for tar cvf - [filename] | gzip > [filename].tar.gz

i'd like to have an alias (or something similar) where i can type a command like "archive" and a filename and have it tar and gzip the file, so...

$ archive filename

results in filename.tar.gz...do i have to write a script to do this?
# 2  
Old 12-11-2007
Quote:
Originally Posted by bcamp1973
do i have to write a script to do this?
Frightening, but that's how I would do it.

For example, create a $HOME/bin directory and add that to your path, then put your useful scripts in there.
# 3  
Old 12-11-2007
frightening? does that mean it's a bad idea? i'm very much a *nix noob, so don't want to do anything stupid. I'm trying to archive files using tar (recommended to me elsewhere) then i figured i'd compress them to save disk space. maybe I shouldn't be doing that? Smilie
# 4  
Old 12-11-2007
Quote:
Originally Posted by bcamp1973
frightening? does that mean it's a bad idea?
No, it's not really frightening, and yes it's exactly the right thing to do. Smilie
# 5  
Old 12-11-2007
ah, cool...thanks! Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

2. Shell Programming and Scripting

Bus error while using command tar -cvf

Hi, I am working on a mac OSX machine. I am getting bus error :confused: when i use the command tar -cvf file1.tar file1 What could be the reason for this?? (1 Reply)
Discussion started by: shweeths
1 Replies

3. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

4. UNIX for Dummies Questions & Answers

Jar/Tar to a diffent folder/same folder w/ filename

Hi, I want to extract myfile.war to a folder which is in the same folder with war file.I did this as normal: jar -xvf myfile.war But it exploded all the content of file to the same level folder instead of that I was expecting to create a folder called myfile. This works with tar: ... (0 Replies)
Discussion started by: reis3k
0 Replies

5. UNIX for Dummies Questions & Answers

gzip filename?

Hi, I want to be able to gzip a file but keep its original name and not give it a .gz extension. And then gunzip the file to the same name as well. Is this possible? Thanks in advance! (1 Reply)
Discussion started by: goochalba
1 Replies

6. UNIX for Dummies Questions & Answers

tar and gzip

Hi, I would like to have a combined gzip and tar that will compress and create multiple output tar.gz files. I want to have multiple files output because i cannot create an archive because there is no more space on my harddisk. I cannot transfer it locally because of slow connection. I want to... (3 Replies)
Discussion started by: tungaw2004
3 Replies

7. UNIX for Advanced & Expert Users

tar/gzip/gz...which one to use?

P0251WLADC.svm_wl1 > /svm_wl1/billing/data/server/archive/ALLEVT $ du -k FEB2006 22050224 FEB2006 As you can see,i have a folder called "FEB2006" which is around 22 GB. i guess zip or compress wont work...( i don know how do we compress a folder) i wished to use ""tar" ( i suppose... (5 Replies)
Discussion started by: abhijeetkul
5 Replies

8. UNIX for Dummies Questions & Answers

using Tar -cvf file.tar "Need Help"

Ok, I use the command tar -cvf ~kw4691/output/test.tar ~kw4691/input on one UNIX server, lets call it sneezy. I FTP the tared file over to another server, lets call it bashful. Use the tar -xvf test.tar command and get the error ~kw4691/input "could not create the directory" /hom/dev/sy40... (7 Replies)
Discussion started by: wev
7 Replies

9. UNIX for Advanced & Expert Users

using TAR -cvf test.tar "HELP"

Ok, I use the command tar -cvf /home/output/test.tar /home/input on one UNIX server, lets call it sneezy. I FTP the tared file over to another server, lets call it bashful. Use the tar -xvf test.tar command and get a error indicating that it is looking for the same directory as where the... (3 Replies)
Discussion started by: wev
3 Replies
Login or Register to Ask a Question