LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 12-07-2017, 09:11 PM   #16
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,479

Rep: Reputation: 620Reputation: 620Reputation: 620Reputation: 620Reputation: 620Reputation: 620

Or if you must use 'ls':
Code:
ls -1 |grep -v ".*\...."
 
Old 12-08-2017, 01:32 PM   #17
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,646

Original Poster
Rep: Reputation: 51
The final solution.

Right! I'll add them to the following three:
Code:
bill@darkstar:/almacen/STORE1/soft/linux/LS/TEST_2$ ls -l
total 1
-rwxrwxrwx 1 bill bill 288 Dec  8 15:18 lq.now*
-rwxrwxrwx 1 bill bill   0 Dec  8 15:19 rotman_4th_ed.mp3*
-rwxrwxrwx 1 bill bill   0 Dec  8 15:19 rotman_ex_7_13.pdf.*
-rwxrwxrwx 1 bill bill   0 Dec  8 15:19 theory\ of\ infinite\ pdf\ groups*
-rwxrwxrwx 1 bill bill   0 Dec  8 15:19 theory-of-infinite-groups*
-rwxrwxrwx 1 bill bill   0 Dec  8 15:19 theory.groups.fin01.burngoog*
-rwxrwxrwx 1 bill bill   0 Dec  8 15:19 theory.of.infinite.groups.htm*
-rwxrwxrwx 1 bill bill   0 Dec  8 15:19 theory_of_infinite_groups.htm*
bill@darkstar:/almacen/STORE1/soft/linux/LS/TEST_2$ find . -type f -regex '.*[^.]...$' -ls   
 37068    0 -rwxrwxrwx   1 bill     bill            0 Dec  8 15:19 ./rotman_ex_7_13.pdf.
 37074    0 -rwxrwxrwx   1 bill     bill            0 Dec  8 15:19 ./theory\ of\ infinite\ pdf\ groups
 37073    0 -rwxrwxrwx   1 bill     bill            0 Dec  8 15:19 ./theory-of-infinite-groups
 37072    0 -rwxrwxrwx   1 bill     bill            0 Dec  8 15:19 ./theory.groups.fin01.burngoog
bill@darkstar:/almacen/STORE1/soft/linux/LS/TEST_2$ find . -iname "*[^.]???"
./rotman_ex_7_13.pdf.
./theory of infinite pdf groups
./theory-of-infinite-groups
./theory.groups.fin01.burngoog
bill@darkstar:/almacen/STORE1/soft/linux/LS/TEST_2$ 
bill@darkstar:/almacen/STORE1/soft/linux/LS/TEST_2$ ls *[!.]??? -1
rotman_ex_7_13.pdf.*
theory\ of\ infinite\ pdf\ groups*
theory-of-infinite-groups*
theory.groups.fin01.burngoog*
bill@darkstar:/almacen/STORE1/soft/linux/LS/TEST_2$
 
Old 12-09-2017, 04:01 AM   #18
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 6,979
Blog Entries: 4

Rep: Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681
Quote:
Originally Posted by stf92 View Post
The final solution.
please mark your thread SOLVED.
 
Old 12-09-2017, 06:08 PM   #19
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,646

Original Poster
Rep: Reputation: 51
You make look at the thread to make such a stupid remark?
 
Old 12-09-2017, 06:41 PM   #20
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,646

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by Kenhelm View Post
GNU coreutils ls can hide entries matching a shell pattern.
Code:
ls -I '*.???'         # The pattern needs to be in quotes or it will be expanded before ls starts
From the man page:
Code:
-I, --ignore=PATTERN
       do not list implied entries matching shell PATTERN
Unfortunately it does not list aaaa.bbb.cccc when it should, because .bbb is not at the end of the filename. As to
Code:
ls -1 |grep -v ".*\...."
it goes against Turbocapitalist's advice (http://mywiki.wooledge.org/ParsingLs).

Last edited by stf92; 12-09-2017 at 06:51 PM.
 
Old 12-09-2017, 09:59 PM   #21
Kenhelm
Member
 
Registered: Mar 2008
Location: N. W. England
Distribution: Mandriva
Posts: 340

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by stf92
Unfortunately it does not list aaaa.bbb.cccc when it should, because .bbb is not at the end of the filename.
It works for me
Code:
touch aaaa.bbb.ccc  aaaa.bbb.cccc 

ls -I '*.???'
aaaa.bbb.cccc     

ls --version
ls (GNU coreutils) 8.23
 
Old 12-10-2017, 04:38 AM   #22
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 6,979
Blog Entries: 4

Rep: Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681Reputation: 1681
Quote:
Originally Posted by stf92 View Post
The final solution.
Quote:
Originally Posted by ondoho View Post
please mark your thread SOLVED.
Quote:
Originally Posted by stf92 View Post
You make look at the thread to make such a stupid remark?
please don't do that. it's insulting.
 
Old 12-10-2017, 06:31 AM   #23
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,646

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by Kenhelm View Post
It works for me
Code:
touch aaaa.bbb.ccc  aaaa.bbb.cccc 
ls -I '*.???'
aaaa.bbb.cccc     

ls --version
ls (GNU coreutils) 8.23
My mistake. The problem is it does not list subdirs. I want to list all the subtree starting at the current dir, excepting filenames ending in .??? of course.

This lists the subtree but fails with the subdirs.
Code:
ls *[!.]??? -1
EDIT: this is working:
Code:
ls -R -I '*.???'
 
  


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
Why limitation of 6 or 8 character filenames + extension on older operating systems? Xeratul Programming 14 10-07-2015 09:44 PM
How to list duplicate filenames wonfineday Linux - Newbie 7 12-07-2011 01:51 AM
list filenames with spaces in a shell script xp_newbie Programming 6 03-15-2009 08:46 PM
script to list the filenames which are in lower case naveensankineni Programming 2 03-12-2008 08:09 AM
Folder List With Numbers Over 100 In Filenames hazmatt20 Linux - General 14 01-09-2006 03:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:33 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