Tuesday, June 17, 2008

sort

Use this commmand to sort a file. For example, suppose we have a file dict with contents
red rojo
green verde
blue azul
white blanco
black negro
Then we can do this:
   % sort dict
black negro
blue azul
green verde
red rojo
white blanco
Here the output of sort went to the screen. To store the output in file we do this:
   % sort dict >dict.sorted  
You can check the contents of the file dict.sorted using car, more, or emacs.

No comments: