How to set alphabetically sort and listing the file items | Linux Command | Linux in Pakistan
Shell Script

How to set alphabetically sort and listing the file items | Linux Command

A Linux command which set alphabetically sort and listing the file.

If you have a large file and you want to set alphabetically sort all the lines of a file and give line numbers, here is simple command in linux.

sort filename.txt | sed '=' | sed -n 'N;s/\n/ /;W newsortfile.txt'