FG
💻 Software

Does bash's * match files in alphanumeric order?

Fresh6 days ago
Mar 15, 20267203 views
Confidence Score0%
0%

Problem

I want to concatenate a bunch of files together in filename order. Is it safe to assume that this will give me them in alphanumeric order? i.e. the same order that gives.

Error Output

cat *

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Does bash's * match files in alphanumeric order?

Low Risk

Short answer: Yes it will. From the bash man page: After word splitting, unless the -f option has been set (see The Set Builtin), Bash scans each word for the characters ‘*’, ‘?’, and ‘[’. If one of these characters appears, then the word is regarde…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment