LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-03-2015, 06:18 AM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
Need the command


Hi,
I want to search all sub-folders for one specific file extension. what is the "ls" command to this?
 
Old 09-03-2015, 06:25 AM   #2
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Find is the command you are after. Make sure to use it recursively.

Code:
man find
in xterm or terminal will lead you on the way. I won't discuss this much further as there are plenty examples on the net.
 
Old 09-03-2015, 07:05 AM   #3
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
But how to search all sub-folders within the current path?
 
Old 09-03-2015, 07:09 AM   #4
Andrey@
LQ Newbie
 
Registered: Feb 2008
Distribution: Slackware
Posts: 22

Rep: Reputation: 1
find . -name "*.yourext"
 
Old 09-03-2015, 07:17 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
While the find command will work, depending on which shell you use their might be inbuilt options. For example, in Zsh you can do this:
Code:
ls **/*.jpg
This will find all files with the .jpg extension in the current directory and all sub-directories.
 
Old 09-03-2015, 07:33 AM   #6
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Many thanks.
I'm not able to find out one Download folder by this

find . -name "*ownload"

can you please advise?
 
Old 09-03-2015, 08:16 AM   #7
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Dear sir, looking back at posts you have done, being able to setup mysql, editing host files etc..

The search for name will find file names not directory names.

I find it hard to believe you wont get search engine results. Search for

Linux cli find directory


It is literraly the first result that pops up.

https://www.google.co.jp/url?sa=t&so...yjGw3hsz034fCA

Now I understand that at times we all need answers, but surely it is not that difficult to find that info between search engines and the man page.

If on the other hand you wish to use regex, sure there are regex gods here and I think that sort of thing is legitimate, but...

You asked two questions.

The first. In a search engine, you can use

linux cli recursive find file format.

Which kindly has been answered already.

And for the second question about directories the link I posted above in this post.

For the folder you downloaded to, check browser settings. If you did not change it, it will be in your home directory, probably labeled Download.

If you used wget, then there is no centralized download folder. It will be the directory you were in at the time or the one you told wget to save to.

Last edited by ericson007; 09-03-2015 at 08:23 AM.
 
Old 09-03-2015, 08:22 AM   #8
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 22.04 LTS
Posts: 240

Rep: Reputation: 67
Quote:
Originally Posted by Huamin View Post
Many thanks.
I'm not able to find out one Download folder by this

find . -name "*ownload"

can you please advise?
Is the folder you're looking for maybe called Downloads? Then try "*ownloads" or "*ownload*"
 
Old 09-03-2015, 08:32 AM   #9
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Based on another thread and many others, op, please consider doing a little more leg work. In most cases for you it will be quicker than us answering.

Refering to your thread

http://www.linuxquestions.org/questi...me-4175552491/

And almost all other threads you started, I cannot see areason why a search engine cannot give you a working solution within 20 minutes, then on top of that it is convenient copy and paste.

I am sorry to sound crude, but heck mate. Let's smarten up on searching a tad.

This forum and a few other sites are absolute treasure troves where I found answers to obscure things.

Please invest in a good linux admin book. You ran mysql at a point on centos, if still using that, michael jang and others have great books. But before spending money, search a bit. Spend some time on the man pages and then after that please ask allyou wish.

You have started 120 threads asking questions that for 90 is available on this site fairly easily in other threads.

Since you are logged in on windows and the time span on this site. I think you are not using linux very often. If this is the case, rather than panicking when the vps goes upside down, just have a small partition running a minimal install of your favorite distro and try building it up to a nice desktop that you can use. Think of it as a backup. In case windows go bottoms up how can i use linux to complete the majority of my work reducing down time.

Now if you need help with something like that, I am all ears, bur as have been said on this site, sadly all to often, please show what you tried then we can assist.

This site is best used as a learning tool, not vendor support. For that there is redhat, oracle, suse et al.

Last edited by ericson007; 09-03-2015 at 08:43 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cygwin simple tar command fails when issues on command line deannad Linux - General 1 06-12-2013 10:22 AM
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 01:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 03:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration