How to sort a file in-place

后端 未结 6 1829
青春惊慌失措
青春惊慌失措 2020-11-30 17:37

When we use sort file command, the file shows its contents in a sorted way what if I don\'t want to get any-kind of output but a sorted file?

6条回答
  •  被撕碎了的回忆
    2020-11-30 18:43

    Do you want to sort all files in a folder and subfolder overriding them?

    Use this:

    find . -type f -exec sort {} -o {} \;
    

提交回复
热议问题