How can I join the results of 2 ls? “I need this because the files are in two different directories, and I need to sort them differently.”
In any case, for the output, I need a regular list with both results.
No need to run twice ls, just specify a few file parameters as arguments.
ls
ls /path/to/first_file_spec* /different_path/to/second_file_spec*
(ls <first dir>; ls <second dir>) | sort ...
:
{ ls folder1 && ls folder2; }
{ ls /etc/fonts && ls /etc/init; }|while read i; do echo $i; done
(, - , ).
, find - "directory:", ls, .
find
find /etc/dpkg/ /etc/apt -mindepth 1 -maxdepth 1 | sort
, printf,
find /etc/dpkg/ /etc/apt -mindepth 1 -maxdepth 1 -printf "%f\n" | sort
Source: https://habr.com/ru/post/1776001/More articles:Autotools with data files - autotoolsWhy are all actions / classes displayed in the application list during installation? - androidChanging an immutable python type when iterating through a mutable container such as a list - pythonDictionary words to download - nlpКакова цель передачи родителя в конструктор класса Qt? - classКак я могу работать с исходным кодом UTF-16LE в Ruby? - rubymvn clean install using java 1.5 or 1.6 - mavenC #: What is the best way to send a support request by email? - c #How to change tray icon using Java? - javaWPF Dependency Property Property - Template Parent Element - propertiesAll Articles