prova1 is a file with some text.When I run this code prova1 become empty:sort prova1 > prova1I know that to achieve the effect I can do: sort prova1 -o prova1I would just know the reason :)
Why this sort command gives me an empty file?
terminal;sort
This is because the redirection is carried out first: >prova1 truncates your file so that the sort finds nothing. sort prova1 > prova1_sorted would work as you expect.