Brian Mo
Brian Mo

Reputation: 29

How to check whether a s3 object is in ASCII text

When we want to check whether a file is ASCII text file, we can use this command

    ~$ file some_file_content_unknown
    some_file_content_unknown: ASCII text

Is it possible to use file command to check a aws s3 object, something like below (but it's not working)

~$ file s3://bucketa/prefixb/some_file_content_unknown

Upvotes: 0

Views: 47

Answers (2)

pierpy
pierpy

Reputation: 1322

As already answered file or other utilities cannot work. A solution could be to use metadata during the upload, so that it can be read with head-object without having to download the entire object first. Read docs here

Upvotes: 1

John Rotenstein
John Rotenstein

Reputation: 270059

The file command does not know how to access Amazon S3.

You will need to download the object first, the run file against the downloaded file.

Upvotes: 2

Related Questions