As sort
's man page says:
-m, --merge
merge already sorted files; do not sort
Here are my two simple text files and the result of sort
command with -m
option:
soroush@pop-os:~/Desktop$ cat a_file.txt
aa
ff
hh
bb
soroush@pop-os:~/Desktop$ cat b_file.txt
gg
tt
ss
ii
cc
soroush@pop-os:~/Desktop$ sort -m a_file.txt b_file.txt
aa
ff
gg
hh
bb
tt
ss
ii
cc
I expected to see this output:
aa
ff
hh
bb
gg
tt
ss
ii
cc
Could anyone explain this behavior please?