Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash join ls output

Tags:

bash

How can I join 2 ls results ? - I need this because the files are in 2 different directories and I need to sort them in different ways.

Anyway for the output I need a normal listing with both results.

like image 502
johnlemon Avatar asked Jan 21 '23 01:01

johnlemon


1 Answers

No need to run ls twice, just put multiple file specifications as arguments.

ls /path/to/first_file_spec* /different_path/to/second_file_spec*
like image 157
Dennis Williamson Avatar answered Jan 31 '23 04:01

Dennis Williamson