Command :
$ sort -n file1.txt
Output :
15
39
50
89
200
$ sort -n filename.txt
# sort command sorts outuputs alphabetically as for example:
cat file | sort # a b b c
sort -r file # sorts reversely: c b b a
sort -u file # sorts and outputs uniquely: c b a
sort -n file2 # sorts numerically: 1 2 3
Command :
$ cat > file1.txt
50
39
15
89
200
Command :
$ sort -r file.txt
Output :
satish
rajan
naveen
harsh
divyam
chitransh
abhishek
$ sort -r inputfile.txt