let's assume I have a text file abc.txt
and I want to do some operations on it and then save the result to itself like this:
sort abc | head -10 | tail -3 | cut -f3 > abc
or more simple:
sort abc > abc
I understand that the contents of the file will be deleted because I have used the >
operator. My question is: why is this happening?