溫馨提示×

linux shuf文件內容如何打亂

小樊
104
2024-06-26 01:17:42
欄目: 智能運維

要打亂文件內容,可以使用shuf命令。例如,要打亂文件example.txt的內容,可以使用以下命令:

shuf example.txt

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

shuf example.txt > shuffled_example.txt

這樣就會將打亂后的內容輸出到shuffled_example.txt文件中。

0