Question:
Quiet command output in Unix?
Jason
2006-11-14 12:36:01 UTC
Hello all,
Say I have two files:
file1.me
file2.me
one is compressed: file1.me.Z

I want to uncompress all file* files but I don't want the error message that says "file2.me.Z does not exist" Is there a way to silence the uncompress function?

Thanks for your help in advance!
Four answers:
Achint Mehta
2006-11-14 12:55:31 UTC
Assuming that you are using gzip to uncompress the files use the following command

gunzip file1.me file2.me 2>err



This would create a file "err" in which the error messages would be stored. The "2" in the above command refers to standard error.



If you do not want a file to be created ("err" file in above case) use the following command



gunzip file1.me file2.me 2>/dev/null



Now figure out what /dev/null is :-)
goggin
2016-11-25 00:38:04 UTC
? are you attracted to that output? if no, only redirect to /dev/null are you attracted to area of... in accordance to key terms? use grep to opt for lines containing the most-word (and a context, in case you want, with -A and -B)... that's a "depending" log? only imagine your self a script to extract the documents you've an pastime and reformat them, then authentic outputting... (awk can help alot, or perl, or... too many...)
2006-11-14 12:48:21 UTC
Depending on which zip you are using, you should be able to use:



unzip -q file*

or

unzip -qq file*



If you want to make sure you don't get a list of "file missing" errors, try:



unzip -qq file*.Z



so that the unzip utility only tries to affect .Z zipped files.
pixelcort
2006-11-14 12:53:29 UTC
Try routing its stdout to /dev/null:



compress ... >> /dev/null


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...