Hello Forum people. I have been searching the Internet for the answer to my question, and I think it may be related to the command "sort" or "uniq"
In Example. I have a file with lines of text that are not in alphabetical order.
Code:
shine:~ jaysunn$ cat file1
asdkfokaosfknksdigjisjigjdigjmnh
ojdfojjjojddfpdfo sdfokpoopsdf jsdfojsdf
wiewieiemd iuh asdlk this is a file blah blah
shine:~ jaysunn$
What I would like to have happen is. I want to issue a command that will take the text within file1 and put it in alphabetical order from a-z. I am pretty sure that sort or uniq can achieve this. I have tried this and was unsuccessful. The command would alphabetize the text and output file2.
Code:
shine:~ jaysunn$ sort file1 | uniq -c > file2
4
1 asdkfokaosfknksdigjisjigjdigjmnh
1 ojdfojjjojddfpdfo sdfokpoopsdf jsdfojsdf
1 wiewieiemd iuh asdlk this is a file blah blah
shine:~ jaysunn$
Thanks in advance.
Jaysunn