On Tue, 22 Apr 2003, Michael Kahle wrote:
> To clear up why I became root to do this operation... I thought it faster
> than copying the file somewhere else and then gunzip-ing the file. I
> thought it faster to type su and then password then to copy the file into
> another location and have my way with it. The problem with having my own
> unix box is that I can bail myself out of tons of permissions situations
> just by becoming root. Very very bad, I know. If I could have become
> familiar with Unix without having to set one up myself first, I would most
> likely have developed better habits than I have now.
>
> I would type the following:
>
> $ gzip -d filename.gz
> Gzip: changelog: Permission denied
> $
>
> So, I was in /usr/share/doc/, and I didn't have permissions to change the
> files that existed in there. Which is why I had to be root to do the
> decompress operation as above. I could have copied the file to somewhere
> else and then did it as non superuser. But as we all know, this is silly.
> There are far better ways to do this than I had been doing and I'm glad I
> asked.
There is a faster, nonroot way to uncompress that file to another file.
Try "gzip -c filename.gz > ~/myfile.txt" What this does is uncompress
the file and pipes it to the terminal (standard output, actually), then
the ">" symbol tells it to write whatever should be written to the
terminal to the following file "~/myfile.txt", where the "~" symbol is
shorthand for "my home directory".
As a footnote:
">>" will append instead of write to a file. "~user" (where
user is a valid name) is a shortcut to the user's home directory.
~ Jesse Meyer
--
...crying "Tekeli-li! Tekeli-li!"... ~ HPL
icq : 34583382 | === ascii ribbon campaign ===
msn : dasunt@hotmail.com | () - against html mail
yim : tsunad | /\ - against proprietary attachments
Attachment:
pgppIdnfcOlZc.pgp
Description: PGP signature