PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > find (path/filename) > 108 characters
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

find (path/filename) > 108 characters

Réponse
 
LinkBack Outils de la discussion
Vieux 14/03/2008, 18h17   #1
Cyrus Kriticos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find (path/filename) > 108 characters



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.
  Réponse avec citation
Vieux 14/03/2008, 18h37   #2
pk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find (path/filename) > 108 characters

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.
  Réponse avec citation
Vieux 14/03/2008, 19h18   #3
Charles Russell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut find (path/filename) > 108 characters

Is there a simple way to print out all the files in a directory tree
that have pathname + filename > 108 characters?
  Réponse avec citation
Vieux 14/03/2008, 19h41   #4
Charles Russell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find (path/filename) > 108 characters

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.
  Réponse avec citation
Vieux 14/03/2008, 19h45   #5
pk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find (path/filename) > 108 characters

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.
  Réponse avec citation
Vieux 14/03/2008, 19h45   #6
Charles Russell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find (path/filename) > 108 characters

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.
  Réponse avec citation
Vieux 14/03/2008, 22h20   #7
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find (path/filename) > 108 characters

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
  Réponse avec citation
Vieux 15/03/2008, 09h18   #8
Cyrus Kriticos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find (path/filename) > 108 characters

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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h45.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18477 seconds with 16 queries