Questions tagged [recursive]
Operating on a directory and its subdirectories, recursively.
355 questions
0 votes
3 answers
163 views
Why can't I use `rm -r` on a symlink pointing to a directory?
I understand that in unix systems symlinks can link to files and directories and are files themselves so if I want to remove a symlink I need to rm symlink without the trailing /. But they otherwise ...
0 votes
0 answers
49 views
How does the search algorithm in Gnome Files traverse the directory tree?
If I place myself in some directory C and press the search lens and type some keywords, are files matching the keywords in directory C displayed first? This is not obvious, for instance if the search ...
1 vote
1 answer
125 views
How to define a recursive alias in csh (intentionally!)
It is known that attempting to invoke a custom alias inside itself (be it directly; or indirectly via intermediate aliases that call each other) would cause an "Alias loop." error, and ...
1 vote
2 answers
111 views
recursive call to gnu parallel
I have a very slow samba share that i can access through wsl on my windows laptop. On windows accessing the share doesn't take much time but on linux it is in order of seconds. I basically replicate ...
0 votes
3 answers
205 views
what is recursion when applied to the bash shell?
I keep hearing people talk about "recursion" for example, when you copy and paste a file and a directory you need to also put in the -r flag to tell the cp command to copy the directory &...
-1 votes
1 answer
198 views
why doesn't cp automatically copy directories recursively?
Why does cp need -r flag to copy "recursively"? Why doesn't cp automatically copy directories recursively? Would that make more sense? Is there some documentation that explains this decision?...
1 vote
1 answer
175 views
Recursively move and overwrite
I am using Ubuntu 24.10 and have a directory containing files and subdirectories: main-dir file1 file2 file3 subdir1 file1-1 file1-2 subdir1-1 file1-1-1 ...
2 votes
1 answer
159 views
rsync recursive jumps across directories
I've used rsync recursively and, to my surprise, I witnessed this very strange behaviour in the output (I don't remember if it was deleting or creating or a combination, but I think it won't matter): ...
0 votes
2 answers
120 views
How to loop through multiple subdirectories and change file extension
I was assigned to manage a legacy codeIgniter 3 code base. There is this error that the website doesn't load images that are .JPG. Rather than making it not case-sensitive we want to change every .JPG ...
0 votes
1 answer
784 views
Delete all the files in a folder and its subfolders without deleting the folder structure
I am replicating a server -> I want to delete all the files inside the folders and the subfolders, without deleting the directories themselves. Example: home\apps\Batches\hello.txt home\...
0 votes
1 answer
1k views
Recursively fix corrupted video files with ffmpeg
I think I'm pretty close to having a code which will start at a directory, then spit out a fixed copy, using fd (instead of find) and ffmpeg. I have written the if statement here as psudo-code: for i ...
0 votes
1 answer
128 views
Can find reliably call itself from -exec without breaking the semantics of the two instances?
Following http://superuser.com/questions/1780479 and http://superuser.com/questions/1777606, we issue the following script to compare times of the same–full-path symlinks under directories $1 and $2: #...
0 votes
1 answer
1k views
how do you get the total size of wget recursive without downloading all the files first?
i have something large to download recursively the size is estimated to be > 150GB (someone told me this is roughly the size) right now i do not have the storage space so i need to figure out how ...
1 vote
1 answer
348 views
How can I rename files recursively using a regular expression
I have hundreds of files on a hard drive with many directories and sub directories which start with: 1.1, 1.2, 1.3, 2.1, 3.1, 9.1, 10.1, 10.2, Etc Etc... The problem is that when I list them they ...
0 votes
0 answers
67 views
bash: enter every folder, search for filetype. If missing. download that file
new bash-beginner here. As a start into scripting I want to write a simple bash-script, which enters every folder within a specific path, check for filetype and if it is missing, do a certain wget-...