Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のファイルnumbers.txtの値を並べ替えたいと思います。以下は例です
1.1 1.2 10.0 2.2 1000.0
ただし、次のcmdを実行すると
sort numbers.txt
私は次のようになります:
1.1 1.2 10.0 1000.0 2.2
数値を適切に並べ替えるには、どのcmdを使用する必要がありますか?
-n辞書式順序ではなく、フラグを使用して数値で並べ替えます。
-n
sort -n numbers.txt