0

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

2
  • 2
    So, something like aws s3 cp s3://example-bucket/file.name - | file - ? Commented Jan 28 at 4:05
  • @AnonCoward yeah, it work! Thanks for the answer Commented Jan 29 at 4:09

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.