Mint
Mint

Reputation: 53

How to reverse and sort files in Linux?

I'm trying to take files in a directory and reverse them and then sort them alphabetically. So that Cat Dog So the output Would be God Tac

Upvotes: 3

Views: 7740

Answers (2)

G. Emadi
G. Emadi

Reputation: 230

If you want to work with files and folder names, not to change their names, I hope this will help you:

ls your-path | rev | sort

Upvotes: 0

Kornelia Kobiela
Kornelia Kobiela

Reputation: 477

If you use terminal write:

ls -r

It show you your files and directories in reversed order. I don't know what kind of Graphical Interface you use. In Gnome you must show files as a list and sort by name (clicking it) diminishing

Upvotes: 11

Related Questions