gzip help
Hi
i have used this command before but i cant remember the syntax quite well its ls -l Apr-[0-3][0-9]-2008-*.log | xargs -i@ gzip@ but it is not working error : xargs: gzip@: No such file or directory |
Quite right you can't remember the syntax. What are you trying to do?
If you want to collect some log files into an archive, you don't want the -l on the ls command. You don't even want to be using the ls command. And you don't want gzip, you want tar. tar cfz sometarfile.tgz Apr-[0-3][0-9]-2008-*.log cfz: c = create, f = filename will be given, z = compressed |
I can only guess that you may be after something like this:
Code:
ls -1 Apr-[0-3][0-9]-2008-*.log | xargs -i gzip {} Hope this helps. |
Or if you're trying to zip up everything separately, use something like:
Code:
find ./ -maxdepth 1 -iname 'Apr-[0-3][0-9]-2008-*.log' -exec gzip {} \; |
This was what i was looking for cheers
Quote:
|
Why not simply...?
Code:
gzip Apr-[0-3][0-9]-2008-*.log |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 09:09 AM. |