I have files named file.88_0.pdb, file.88_1.pdb, ..., file.88_100.pdb. I want to cat them so that file.88_1.pdb gets pasted after file.88_0.pdb, file.88_2.pdb after file.88_1.pdb, and so on. If I do cat file.88_*.pdb > all.pdb, the files are put together in the following order: 0 1 10 11 12 13 14 15 16 17 18 19 2 20..., etc. How do I put them together so that the order is 0 1 2 3 4 5 6...?
cat files in specific order based on number in filename
files;cat;text formatting
Use brace expansion cat file.88_{0..100}.pdb >>bigfile.pdbTo ignoring printing the error messages for non-existent files use:cat file.88_{0..100}.pdb >>bigfile.pdb 2>/dev/nullIn the zsh shell also you have the (n) globbing qualifier to request a numerical sorting (as opposed to the default of alphabetical) for globs:cat file.88_*.pdb(n) >>bigfile.pdb 2>/dev/null