项目作者: zetamatta

项目描述 :
Search filename from the subdirectories of the current directory.
高级语言: Go
项目地址: git://github.com/zetamatta/findo.git
创建时间: 2017-11-28T12:07:46Z
项目社区:https://github.com/zetamatta/findo

开源协议:MIT License

下载


Go Report Card

findo - a command like find

The findo search files from the tree below the current directory.

  1. $ findo -h
  2. Usage of findo.exe:
  3. -1 Show nameonly without size and timestamp
  4. -d string
  5. Set start Directory (default ".")
  6. -f Select fileonly not including directories
  7. -ignoredots
  8. Ignore files and directory starting with dot
  9. -in duration
  10. Files modified in the duration such as 300ms, -1.5h or 2h45m
  11. -notin duration
  12. Files modified not in the duration such as 300ms, -1.5h or 2h45m
  13. -l Show size and timestamp
  14. -q Enclose filename with double-quotations
  15. -v verbose (use with -x)
  16. -x string
  17. Execute a command replacing {} to FILENAME

Example-1: no arguments and no redirect

findo prints the tree under the current directory.

  1. $ findo
  2. .git
  3. 4,096 2018-06-22 18:08:28.6822833 +0900 JST
  4. .git\COMMIT_EDITMSG
  5. 347 2017-12-29 08:54:25.1692404 +0900 JST
  6. .git\FETCH_HEAD
  7. 96 2018-06-22 18:08:28.6197845 +0900 JST
  8. .git\HEAD
  9. 23 2017-11-28 21:04:59.3605057 +0900 JST

Example-2: when the standard output is redirected

Timestamp and size are omitted.

  1. $ findo | more
  2. .git
  3. .git\COMMIT_EDITMSG
  4. .git\FETCH_HEAD
  5. .git\HEAD
  6. :

Example-3: A filename pattern(wildcard) is given.

  1. $ findo H*
  2. .git\HEAD
  3. 23 2017-11-28 21:04:59.3605057 +0900 JST
  4. .git\hooks
  5. 4,096 2017-11-28 21:04:59.1064544 +0900 JST
  6. .git\logs\HEAD
  7. 716 2018-06-22 18:08:28.6822833 +0900 JST
  8. :

Example-4: Executing commands

  1. $ findo -X "wc -l {}" *.md *.go
  2. wc -l "README.md"
  3. 102
  4. wc -l "hoge and hoge.md"
  5. 0
  6. wc -l "main.go"
  7. 124
  8. wc -l "system_linux.go"
  9. 15
  10. wc -l "system_windows.go"
  11. 21

History

v0.3.0

  • Add option: -X: same as -x,-v and -q
  • Support Linux not only Windows

v0.2.0 (20180912)

  • Add options: -x,-q,-d,-l
  • Support Multi patterns
  • If stdout is terminal, output simple. and add -l option

v0.1.0 (20171128)

  • First release