![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 | Thread Starter | Forum | Replies | Last Post |
| find the length of file names in a directory? | koti_rama | Shell Programming and Scripting | 5 | 06-04-2008 07:19 AM |
| help need to find the length of a variable | smr_rashmy | Shell Programming and Scripting | 7 | 02-18-2008 02:02 AM |
| What the command to find out the record length of a fixed length file? | tranq01 | UNIX for Dummies Questions & Answers | 3 | 10-19-2007 11:16 AM |
| Find, make and move file based on username | Helmi | UNIX for Dummies Questions & Answers | 5 | 04-19-2007 06:49 PM |
| find filename based on file content | kollerj | UNIX for Dummies Questions & Answers | 4 | 06-02-2001 10:31 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Need find a file based length
Can some please help me? Want to find files over 35 characters in length? I am running HPUX. Would it be possible with find?
Thanks in advance |
| Forum Sponsor | ||
|
|
|
|||
|
Using find
Hi,
I think the following script should solve the problem. Code:
#!/bin/ksh
for v in $(find . -name '*' -type f -print ) ; do
f=${v##*/}
if [[ ${#f} -gt 35 ]] ; then
print " $v is the name of file with more than 35 char"
fi
done
Thanks Nagarajan Ganesan. |