Linux

Some of the commands in the previous question can be run with the -r/-R flag. What does it do? Give an example to when you would use it

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

The -r (or -R in some commands) flag allows the user to run a certain command recursively. For example, listing all the files under the following tree is possible when done recursively (ls -R):

/dir1/ dir2/ file1 file2 dir3/ file3

To list all the files, one can run ls -R /dir1