Results 1 to 2 of 2
Hi, I currently have about 60 files in a directory, and I need to concatenate them in order. They have names such as:
OBS_DOMAIN101
OBS_DOMAIN102
OBS_DOMAIN103
....
If I were ...
- 10-24-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 1
Concatenating several files in order
Hi, I currently have about 60 files in a directory, and I need to concatenate them in order. They have names such as:
OBS_DOMAIN101
OBS_DOMAIN102
OBS_DOMAIN103
....
If I were to just do a simple:
cat OBS_DOMAIN* > output.txt
would this concatenate them all in the order they are listed? If not, how would I do this fairly easily?
Thanks.
- 10-24-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Yes, that cat command should expand the files in alphabetical order. Just bear in mind that it would be in the same order as
because it is the shell expansion that is the consistent piece.Code:ls OBS_DOMAIN*
You could also do:
Code:sort OBS_DOMAIN*


Reply With Quote