LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-09-2007, 02:45 PM   #1
swatward
Member
 
Registered: Jan 2005
Distribution: slackware
Posts: 83

Rep: Reputation: 15
Red face List files that don't have a certain extension


EX: If I have a lot of files in a pictures folder, I want to find files in that entire directory that don't have a .jpg extension.

Thanks for your help, hope that makes sense.
 
Old 09-09-2007, 02:48 PM   #2
tommytomthms5
Member
 
Registered: Sep 2007
Distribution: debian based
Posts: 305

Rep: Reputation: 30
and you wanna do it with or without gui?
 
Old 09-09-2007, 02:49 PM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
ls | grep -v ".jpg"?
 
Old 09-09-2007, 02:54 PM   #4
tommytomthms5
Member
 
Registered: Sep 2007
Distribution: debian based
Posts: 305

Rep: Reputation: 30
nylex, i tested your code it works like a charm on my setup at least
 
Old 09-09-2007, 02:58 PM   #5
swatward
Member
 
Registered: Jan 2005
Distribution: slackware
Posts: 83

Original Poster
Rep: Reputation: 15
Without gui is fine. Thank you very much for that Nylex, it works perfect.
 
Old 09-09-2007, 03:02 PM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
just another option:
Code:
ls -I *.jpg
 
  


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
Need bash script to list files, drop extension and dump to file talwar_ Programming 10 06-03-2011 10:18 AM
Reinstating a files extension Cripple Linux - Newbie 3 01-22-2006 05:12 PM
Extension files BC1 Linux - Software 5 12-20-2004 04:41 AM
What to do about these files with .new extension? Slovak Slackware 1 11-23-2004 05:50 PM
How program to read files with extension .dat y .cfg files COMTRADE in fedora 1? ivonne Linux - Software 0 11-22-2004 12:42 PM


All times are GMT -5. The time now is 05:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration