Uncompress *.Z files in a folder returns error - gzip

To estract a single .Z file from a given folder I use uncompress file.Z in a terminal and it works flawlessy. If, in the same folder, I want to extract all the .Z files I use uncompress "*.Z" or uncompress '*.Z' or uncompress \*.Z. But they all give the same error:
`gzip: *.Z: No such file or directory`
Same story if I use the "extended" extension proper of each file, that is file.fitz.Z.
How do I uncompress all the .Z files? What is going wrong?

From the answer on U&L, it simply works as:
uncompress *.Z
because all the quotes I have tried escape the * character, causing it to be interpreted literally instead of as a wildcard.

Related

Wget file format

I have to download all site content and then parse the downloaded folder for "*.pdf" files. I am downloading site using wget -r --no-parent http://www.example.com/ But the problem is that sometimes link looks this
http://www.foodmanufuture.eu/dpubs?f=K20
and the dowloaded pdf is downloaded with name "dpubs?f=K20" and file format is not specified, it does not look like this "dpubs?f=K20.pdf", is there a way to check how many pdf files I have in this folder?
Have you tried the --content-disposition flag? From the man page:
If this is set to on, experimental (not fully-functional) support for "Content-Disposition" headers is enabled. This can currently result in extra round-trips to the server for a "HEAD" request, and is known to suffer from a few bugs, which is why it is not currently enabled by default. This option is useful for some file-downloading CGI programs that use "Content-Disposition" headers to describe what the name of a downloaded file should be.
So it tries to ask the server for a filename. I tried it for the URL you gave and it seemed to work.
You could use the command
file filename
Like this:
file pdfurl-guide
pdfurl-guide: PDF document, version 1.5
You could use:
file *
To know exactly which files in your folder are pdf files

Moovweb - uncompress gzipped outgoing_response.http content?

I have a Moovweb project and I'm trying to compare the incoming_response.http and outgoing_response.http files in tmp/messages/... folders.
The incoming_response.http from the upstream server is saved in plain text,
but the outgoing_response.http file is gzipped content!
How can I convert it to plain text so I can look through the response?
Thanks!
put this in your main.ts files:
export("disable_compression", "true")

Objective-C NSString pathExtension for example.tar.gz?

When calling the pathExtension method on a string that contains something such as "example.tar.gz" I get ".gz" as the result. I can do some string manipulation to get the real extension, but I'm number wondering if there is a built in method that I'm overlooking? (I have checked the docs, but I don't see anything).
Obviously pathExtension is working as expected in this case. The documentation for pathExtension says:
The path extension is the portion of the last path component which
follows the final period, if there is one.
I can see where you are coming from with your example of a tarred gzipped file. However, I would say that .gz is the extension. Unzipping the file (with gzip) will result in a .tar file which can be extracted with tar.
I assume that the convention of naming files with the .tar.gz extension started before tar was able to also perform the gzip compression. The gzip application appends .gz to the filename of the file being compressed. For example, gzipping a log file, access.log, will result in a file called access.log.gz.
The .tgz extension has been used for tarred gzipped files particularly where the filename needs to be preserved on file systems that would mangle the extension (e.g. DOS).

How should you write the prep stage when the source file is a .gz?

The setup macro cannot handle a .gz file. I think I should extract the source .gz file without deleting it (decompressing with gzip deletes the file normally), and then manually cd into the uncompressed directory.
I am wondering if this is a good solution.
You cannot extract a directory from just a .gz file. That would be a .tar.gz file. The extraction of a .tar.gz file does not normally delete the .tar.gz file.

How to uncompress and import a .tar.gz file in kettle?

I am trying to figure out how to create a job/transformation to uncompress and load a .tar.gz file. Does anyone have any advice for getting this to work?
you want to read a text file that is compressed?
Just specify the file in the text file input step in the transformation - and specify the compression (GZip). Kettle can read directly from compressed files.
If you do need the file uncompressed then use a job step - not sure if there is a native uncompress, but if not just use a shell script step.
There is not such component in kettle to uncompress the tar.gz file i found.
But if we have the csv file text compressed in gizip format we can use gzip input component.