Saving File/Directory through command line without knowing file type or name

Hello,

Is there a way to save a file onto your computer from IPFS through the command line when you don’t know the file type? Can you do the same for a directory?

I’ll appreciate fast a fast response,
Thank you in advance

That’s the point: a directory is a directory, and the directory contents, when you list them in IPFS, will tell you the file names & file extensions and therefore the file types. That’s also how it’ll be if you export the directory to your default file system. So if you have a single file, it’s best to put it in a directory, when adding it to the IPFS, i.e. “wrapping” it with the -w option. If you don’t do that you might still have some luck with ipfs cat <hash> and piping that to the file command. But that doesn’t work with all file types. And you’ll definitely won’t know the original filename.

Okay, thank you, I got it