Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 02-09-2009, 03:36 AM   #1
Registered: Jan 2006
Location: Lithuania
Distribution: Arch, Debian
Posts: 193

Rep: Reputation: 16
Match all files except directories ?


What wildcards I should use to do that ?

Old 02-09-2009, 03:49 AM   #2
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
I guess you could use this:

find /whatever/dir/ \! -type d
Note that this will list anything that's not a directory. It will also list symlinks, including those that point to directories, so be careful with whatever you are going to be doing. Also, the "!" needs escaping in bash because that character has a special meaning in bash. But if you are using another shell it might not be necessary.


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
Copying files and sub-directories of a directory except the directories named ".abc" sri1025 Linux - General 2 08-24-2010 09:53 AM
Select the files of a directory that match a specific pattern jianelisj Linux - Newbie 2 03-17-2008 01:25 PM
Updating header files to match source fallen3019 Linux - Kernel 3 05-22-2007 10:10 AM
compare two files in C and print the line when they do not match calorie712 Programming 7 04-13-2006 02:56 AM
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 04:22 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:40 AM.

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