How to display only file names in AWS s3 ls command?

AWS CLI s3 ls command list the bucket objects (file) along with the folder (key) and there is no option to change this behavior. However, you can pipe the output of the AWS CLI command and use programs like awk or sed to get only the folder name from the output as shown below –

Leave a Reply