要打亂文件內容,可以使用shuf命令。例如,要打亂文件example.txt的內容,可以使用以下命令:
shuf
example.txt
shuf example.txt
這將會隨機打亂example.txt文件的行順序。如果想要將打亂后的內容輸出到另一個文件中,可以使用重定向符號>:
>
shuf example.txt > shuffled_example.txt
這樣就會將打亂后的內容輸出到shuffled_example.txt文件中。
shuffled_example.txt