A
A
Asparagales2018-11-07 08:27:55
linux
Asparagales, 2018-11-07 08:27:55

What does recursion mean in bash?

I still can't figure out what recursion on the command line and the -r option mean in many console utilities. For example, I use the following command:
ls /путь до каталога > file.txt
This command outputs a list of subdirectories to the file in alphabetical order (the first level of nesting).
I thought that by adding the -r option, the ls command would list the contents of the subdirectories themselves, but it displays the same list, only in reverse alphabetical order. But their contents (the second level of nesting) are displayed to me by the command
ls /путь до каталога/* > file.txt

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
krypt3r, 2018-11-07
@Asparagales


-r, --reverse
reverse order while sorting
-R, --recursive
list subdirectories recursively

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question