There are a lot of directories and files in the directory / home / user / files . In each directory, including the above, are files. It is necessary from the above directory to get a list of all directories and subdirectories enclosed in them, as well as files. Get as list:

/path/to/file.ext

As I understood, the line will suit me:

find . -name "*" -type f -exec ls -l {} \; 

But it displays the result in "ls -l", but it cannot be parsed.

    2 answers 2

    To get a list of files with absolute paths, specify the absolute path to this directory:

     $ find /абсолютный/путь/к/каталогу -type f 

    in case this is the current directory, you can use, for example, the value of the $PWD environment variable:

     $ find $PWD -type f 

    if you need not only files (as indicated in the command given by you), but also directories including (as indicated in the question header), then add to the command another -o -type d :

     $ find /абсолютный/путь/к/каталогу -type f -o -type d 

    in general, objects in the file system are not limited to (regular) files ( f ) and directories ( d ). there are also block ( b ) and symbolic ( c ) devices, named pipes ( p ), sockets ( s ), and symbolic links ( l ). See man find description of the -type option.

    if you remove the mention of this option at all, then all types of objects will be displayed:

     $ find /путь 
    • Thank! The last command is what you need. - kompas
    • @kompas, I added the answer. - aleksandr barakin
    • Enough (already) the penultimate. And in general, I needed only files and directories. =) - kompas

    Alternatively, you can use the -R option of the ls utility

     ls -R . 
    • Thank you, but not exactly what you need. I would be in the format: / path / to / file1 / path / to / file2 - kompas