Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Asked 9 years, 3 months ago. Active 2 months ago. Viewed k times. I am using cURL to try to download all files in a certain directory. Martin Prikryl k 46 46 gold badges silver badges bronze badges.
Alex Gordon Alex Gordon 50k gold badges silver badges bronze badges. Do you want to download the whole directory and wildcard is not really relevant here or just some files in it matching the wildcard? Are you bound to curl? To be honest, it's one of the most hard-to-use tools I've ever seen. What is your platform? Because in the post you mention bash, and in the answer comments you mentioned. Also, how is sftp relevant? And does your example actually use FTP?
Show 1 more comment. Active Oldest Votes. The default maximum depth is five layers. To recursively search for a pattern, invoke grep with the -r option or —recursive.
When this option is used grep will search through all files in the specified directory, skipping the symlinks that are encountered recursively. This will show literally all the files in every subfolder. The ls command is used to list files or directories in Linux and other Unix-based operating systems.
Just like you navigate in your File explorer or Finder with a GUI, the ls command allows you to list all files or directories in the current directory by default, and further interact with them via the command line.
To include all subdirectories in a search, add the -r operator to the grep command. This command prints the matches for all files in the current directory, subdirectories, and the exact path with the filename. Default way to search for recursive file, and available in most cases is.
It starts recursive traversing for filename or pattern from within current directory where you are positioned. With find command, you can use wildcards, and various switches, to see full list of options, type.
Improve this question. David Foerster 34k 54 54 gold badges 85 85 silver badges bronze badges. Namshum Namshum 1, 4 4 gold badges 23 23 silver badges 32 32 bronze badges.
Add a comment. Active Oldest Votes. Improve this answer. Maybe telling the person to cd into the directory first could be added to answer. Also this works fine if i own the directory but if trying in a directory say owned by root it didnt. I got the usual permission denied and sudo followed by your command also gave permission denied. IS there a work around without logging in as root? Well I did say "current" directory. The correct use of CD might the subject of another question, and I'm sure it has been.
You can list directories owned by root as long as you have read access to them. Directories owned by root to which the user has read access can be listed with ls -R. It's hard to imagine why you'd want to list directories owned by root to which you don't have read access, but sudo does indeed work if you give the full path.
I'm adding examples for both of these, but excluding the use of CD. Anwar Anwar This is the most powerful approach. That's the best approach in my opinion. Simple and practical. No Software or Plugin required! Todua T. Todua Does this open the save as dialog for every file? Heres one that has none of these drawbacks: "Download Master" is an extension for Google Chrome that works great for downloading from directories.
Peter 2, 2 2 gold badges 21 21 silver badges 35 35 bronze badges. Moscarda Moscarda 3 3 silver badges 14 14 bronze badges. Rushikesh Tade Rushikesh Tade 3 3 silver badges 7 7 bronze badges. This addon is not doing something. Tested at Ubuntu Byte Bitter Byte Bitter 21 3 3 bronze badges. The Overflow Blog. Podcast Who is building clouds for the independent developer?
Exploding turkeys and how not to thaw your frozen bird: Top turkey questions Featured on Meta. Now live: A fully responsive profile.
Reducing the weight of our footer. Linked Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled. Accept all cookies Customize settings.
0コメント