sort file inline
$ sort a.txt
# or
$ cat a.txt | sort$ sort a.txt -o a.txt$ sort a.txt > a.txtLast updated
We can sort file by using sort command for example:
$ sort a.txt
# or
$ cat a.txt | sortBut this will only output to stdout. Some time you want the file to be sorted. Instead you can do
$ sort a.txt -o a.txtnote that this DOEST work and it will TRUNCATE the file
$ sort a.txt > a.txtLast updated