I try to maintain the last lines of a file, but when tail -n 10 test.txt > test.txt
create or empty the file...
SO: Ubuntu server
Example:
#test.txt file 20 May 23 12:24 test.txt
a
a
a
a
a
a
a
a
a
a
use tail -n 10 test.txt > test.txt
new file is empty 0 May 23 12:36 test.txt