Why does it not work?. "sort filename.txt > filename.txt"

Hi. I wonder that when I type:

& sort filename.txt > filename.txt
It doesn’t work. It only ends up becoming a empty file.
I also tried using “wc” command.It also doesn’t work.
anyone can explain for me.
Thanks so much.

and what happens if you do …

ls > filename.txt
cat filename.txt
sort filename.txt > filename.txt
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.