|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Charles Russell wrote: > Is there a simple way to print out all the files in a directory tree > that have pathname + filename > 108 characters? [GNU grep] find /path_to_tree -type f | grep -E "^.{109}" -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Charles Russell wrote:
> Is there a simple way to print out all the files in a directory tree > that have pathname + filename > 108 characters? What do you mean? What commands are you trying? I'm able to print them using, for example, find. (sorry if lines wrap) $ find -type f ../1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/file1.txt ../1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/file2.txt ../1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/file3.txt -- All the commands are tested with bash and GNU tools, so they may use nonstandard features. I try to mention when something is nonstandard (if I'm aware of that), but I may miss something. Corrections are welcome. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Is there a simple way to print out all the files in a directory tree
that have pathname + filename > 108 characters? |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Cyrus Kriticos wrote:
> > > Charles Russell wrote: >> Is there a simple way to print out all the files in a directory tree >> that have pathname + filename > 108 characters? > > [GNU grep] > > find /path_to_tree -type f | grep -E "^.{109}" > That does it. Thanks. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Charles Russell wrote:
> I'm trying to identify path/filenames that are too long for the old > Joliet file system. The code supplied by Cyrus Kriticos does this. Ok sorry, then I misunderstood your request. I thought you were having problems displaying those files. -- All the commands are tested with bash and GNU tools, so they may use nonstandard features. I try to mention when something is nonstandard (if I'm aware of that), but I may miss something. Corrections are welcome. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
pk wrote:
> Charles Russell wrote: > >> Is there a simple way to print out all the files in a directory tree >> that have pathname + filename > 108 characters? > > What do you mean? I'm trying to identify path/filenames that are too long for the old Joliet file system. The code supplied by Cyrus Kriticos does this. |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
2008-03-14, 18:17(+01), Cyrus Kriticos:
[...] > Charles Russell wrote: >> Is there a simple way to print out all the files in a directory tree >> that have pathname + filename > 108 characters? > > [GNU grep] > > find /path_to_tree -type f | grep -E "^.{109}" Note that this is standard POSIX and Unix, not only GNU. See also find /path_to_tree -type f | awk 'length > 108' All those solutions assume that file names don't contain newline characters. -- Stéphane |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Charles Russell wrote:
> Cyrus Kriticos wrote: >> >> >> Charles Russell wrote: >>> Is there a simple way to print out all the files in a directory tree >>> that have pathname + filename > 108 characters? >> >> [GNU grep] >> >> find /path_to_tree -type f | grep -E "^.{109}" >> > That does it. Thanks. But it does not find empty directories with pathname > 108 characters. -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
![]() |
| Outils de la discussion | |
|
|