3

This is my question: How to sort files by file extensions through the command line?

Jorge Castro
  • 73,717
Ederico
  • 6,437

1 Answers1

7

This is what you are looking for:

ls -Xl

From the man file:

 -X                         sort alphabetically by entry extension

This is an example of how you could move .txt files into a test forlder:

mv *.txt test/
bioShark
  • 4,315