How to supress output from tar and unzip commands?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to supress output from tar and unzip commands?
# 1  
Old 12-14-2016
Bug How to supress output from tar and unzip commands?

I have the below two commands in my script.

Code:
tar -xf hello.tar
unzip -o tempp.zip

When i run the script i see the below on my standard out.

Quote:
tar: blocksize = 0
Archive: tempp.zip
extracting: temp.txt
How can i suppress output coming from both the tar and unzip on my standard output.
# 2  
Old 12-14-2016
Do you see them on standard output, or do you see them on your terminal? I suspect they're actually going to standard error, which can be diverted.

Code:
command 2>/dev/null

# 3  
Old 12-14-2016
Quote:
Originally Posted by Corona688
Do you see them on standard output, or do you see them on your terminal? I suspect they're actually going to standard error, which can be diverted.

Code:
command 2>/dev/null

I do not know how to differentiate between terminal and standard output.

With your suggestion I was able to suppress tar output

But, unzip -o tempp.zip 2>/dev/null still prints the output like below which i wish to avoid.

Quote:
Archive: tempp.zip
extracting: temp.txt

Last edited by mohtashims; 12-14-2016 at 04:36 PM..
# 4  
Old 12-14-2016
man unzip:
Quote:
-q perform operations quietly (-qq = even quieter). Ordinarily unzip prints the names of the files it's extracting or testing, the extraction methods, any file or zipfile comments that may be stored in the archive, and possibly a summary when finished with each archive. The -q[q] options suppress the printing of some or all of these messages.
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Tar and unzip on single command

Hi All, First of all I don't know whether this is possible. or no. Thought of getting experts thought. I am having a tar file which contains zipped file in it . I tried individual command with extraction and it worked tar -tvf TRANS_279.tar -rw-rw-r-- qqa00 1394 2016-10-03 10:39:19... (8 Replies)
Discussion started by: arunkumar_mca
8 Replies

2. Shell Programming and Scripting

Supress java error output to shell

Hello, I know this isn't exactly a shell script question but I'm not sure where else to post it. I am running a java program out of a shell script. There are times when I get an error like, "java.lang.ArrayIndexOutOfBoundsException: 22 at blah, blah at blah, blah ... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

3. UNIX for Dummies Questions & Answers

Extract .zip file without using unzip,tar

Hi, Need to extract a file containing multiple .txt files without using tar/unzip as they are not available (1 Reply)
Discussion started by: santoshdrkr
1 Replies

4. Shell Programming and Scripting

Single command - unzip files from a tar command

I have a tar file that contains multiple .Z files. Hence I need to issue a tar command followed by a gzip command to fully extract the files. How do I do it in a single command? What I'm doing now is tar xvf a.tar (this will output 1.Z and 2.Z) gzip -d *.Z (to extract 1.Z and 2.Z) (9 Replies)
Discussion started by: ericlim
9 Replies

5. AIX

how to unzip wget-latest.tar.gz

I download wget-latest.tar.gz from Index of /gnu/wget, however, it saved in my windows as wget-latest.tar.tar After I ftp it to aix server, #file wget-latest.tar.tar wget-latest.tar.tar: data or International Language text how to uzip it? ---------- Post updated at 04:13 PM ----------... (3 Replies)
Discussion started by: rainbow_bean
3 Replies

6. Linux

Unzip selected files in .tar.gz file

Hi All, By accident, i deleted some files. Fortunately I have a backup backup.tar.gz files (750GB). It's too big for me to untar to get the file Is it possible that i could get the selected files in backup.tar.gz if i know exactly where the files are located. Thanks. Ken (1 Reply)
Discussion started by: trongkhuongsg
1 Replies

7. UNIX Desktop Questions & Answers

file zip,rar,tar,compress,uncompress,unzip,unrar

i want know how to compress and uncompress file using unix, compress uncompress,zip,unzip,rar,unrar,how its work and more about this.:confused: (1 Reply)
Discussion started by: ismael xavier
1 Replies

8. UNIX for Advanced & Expert Users

how to unzip and extract tar file in single command

In order to save diskspace and avoid of disk full during unzip then extract the tar file is there any tar unzip command would unzip and extract tar at the same time (test123.tar.gz) thank in advance (6 Replies)
Discussion started by: darkrainbow
6 Replies

9. Shell Programming and Scripting

How do I supress certian output with find?

I am using this command find . -type f -mmin "+$t" > holder Unfortunatley that is also printing files that begin with a period. Such as .bash_history. What can I do to supress files that begin with a period? (1 Reply)
Discussion started by: chrchcol
1 Replies

10. UNIX for Dummies Questions & Answers

Supress screen output...

I need to suppress the output to the screen. I am appending to a file so do not need the output on the screen in the CLI environment. eg. cat $HOME/somefile >> $HOME/anotherfile I am doing this a number of times with SQL output files so I can look at the finished file not on the screen in the... (3 Replies)
Discussion started by: jagannatha
3 Replies
Login or Register to Ask a Question