LinuxCommandLibrary

aws-s3-ls

List S3 buckets and objects

TLDR

List all S3 buckets in your account

$ aws s3 ls
copy
List objects in a bucket
$ aws s3 ls s3://[bucket-name]/
copy
List objects under a specific prefix
$ aws s3 ls s3://[bucket-name]/[prefix/]
copy
Recursively list all objects in a bucket
$ aws s3 ls s3://[bucket-name] --recursive
copy
List with human-readable sizes and summary
$ aws s3 ls s3://[bucket-name] --recursive --human-readable --summarize
copy
List buckets starting with a specific prefix
$ aws s3 ls --bucket-name-prefix [my-prefix]
copy

SYNOPSIS

aws s3 ls [S3Uri] [options]

DESCRIPTION

aws s3 ls lists S3 objects and common prefixes under a specified prefix, or lists all S3 buckets when no URI is provided. The output shows the last modified date, size, and object key for each item.
When listing bucket contents, objects are displayed with timestamps and sizes, while common prefixes (similar to directories) are shown with a PRE indicator. The command supports recursive listing to show all objects under a prefix.

PARAMETERS

--recursive

List all objects under the specified prefix, including nested objects
--human-readable
Display file sizes in human-readable format (KB, MB, GB)
--summarize
Display summary information including total number of objects and total size
--page-size value
Number of results to return in each response (default: 1000)
--request-payer value
Confirm that the requester will pay for request and data transfer costs
--bucket-name-prefix value
Filter bucket list to names beginning with the specified prefix
--bucket-region value
Filter bucket list to buckets in the specified AWS Region

CAVEATS

The --output and --no-paginate global arguments are ignored for this command. Output format is fixed and cannot be changed to JSON or other formats. For programmatic access to S3 listings with flexible output, use aws s3api list-objects-v2 instead.

SEE ALSO

aws-s3(1), aws-s3-cp(1), aws-s3api(1), ls(1)

> TERMINAL_GEAR

Curated for the Linux community

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99