|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
List only files based on a pattern
Hi Gurus,
I need to list only the files with out certain extension. For eg from the following list of files: Quote:
Quote:
Shash |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Use the "find" command.
You can find a short introduction to "find" here. I hope this helps. bakunin |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Apologies, if I 'm not clear enough. I have thousands of file with different names. I need to find the files with out a decimal place followed by a date in the file name which has been showed in the example.
|
|
#4
|
|||
|
|||
|
if the extension of the .txt file... try like... Code:
ls test?.??? ---------- Post updated at 07:40 AM ---------- Previous update was at 07:36 AM ---------- if is numbers only try like.. Code:
ls test[1-9].??? |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Code:
ls | awk -F. 'NF==1' |
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
If you can use
ls , try: Code:
ls !(*.*) Note: Turn on extglob in bash ( shopt -s extglob ). |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Thanks all it worked
![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copying files based on a pattern | 969murali@gmail | Shell Programming and Scripting | 7 | 06-26-2012 12:11 PM |
| Moving multiple files based on the pattern | rudoraj | UNIX for Advanced & Expert Users | 1 | 05-16-2012 05:50 PM |
| print multiple lines from text file based on pattern list | Oyster | UNIX for Dummies Questions & Answers | 1 | 09-14-2011 04:43 PM |
| how to list files with certain pattern | aoussenko | Shell Programming and Scripting | 2 | 02-19-2009 12:47 PM |
| using sed to replace a pattern in list of files | a1_win | Shell Programming and Scripting | 4 | 08-07-2008 07:18 AM |
|
|