How could I find directories with the name of specific length?
For example, I have bunch of directories which have length of the name equal to 33 chars ( a92e8cc611fdebcca3cf2fc8dc02c918 , c442fb3f46d6c8bd17d27245290a9512 and so on).
Does find
utility accepts condition in form of the wc -c ? Or maybe some other utilities should be piped together?
如何以具体篇幅的名称查找名录
原标题:How to find directories with the name of specific length
最佳回答
与全球团结联盟接触的途径很少
$ find . -type d -name "?????????????????????????????????"
$ find /path -type d -printf "%f
" | awk length==33
问题回答
你没有 Java子,但如果你写了档案,以概括你所铭记的任何标准,将其带上 j子。 如果你想tra倒整个目录结构,你就不得不回响,但完全是可行的。
职业介绍,它只是描述的。
阿帕奇共同组织JAR拥有一些可以轻松地从事这项工作的冰箱和目录。
保证:
find dir -name ?????????????????????????????????
(33小时<代码>?)。
find . -type d -exec bash -c x=`basename {}`; [[ ${#x} == 33 ]] && echo $x ;
这可能因为你拥有的档案数量而缓慢。
To clarify:
${#x}
-> finds the length of a string and
basename
-> finds the name of the final directory
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding