I have no idea what I should do to make it work:
find . -name '*.txt' -printf '\t%s\t%f\n' |sort -n -r | > txt.txt
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
This should work
find . -name '*.txt' -printf '\t%s\t%f\n' | sort -n -r > txt.txt
You have to remove the
| at the end,
> means redirect the
stdout(standard output) to a file.
If there is an error that text will be displayed in the
stderr. Which is the standard output for all errors.
If you want to redirect that to a file:
Due note that there is a difference between
>Will overwrite the entire file's content
>>Will append at the end of the file's content