V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
imn1
V2EX  ›  Bash

find 命令如何每文件暂停?

  •  
  •   imn1 · Apr 27, 2017 · 2031 views
    This topic created in 3290 days ago, the information mentioned may be changed or developed.
    find ... -exec cat ...
    显示太快,要回滚才能看到前面的
    期望每找到一个文件,显示完暂停(等待按键,如空格)再继续下一个文件
    5 replies    2017-04-27 18:00:01 +08:00
    Lonely
        1
    Lonely  
       Apr 27, 2017 via iPhone   ❤️ 1
    我记得 xargs 有这个功能
    blankme
        2
    blankme  
       Apr 27, 2017   ❤️ 1
    觉得还是把结果 > 出来更方便一些
    mahone3297
        3
    mahone3297  
       Apr 27, 2017   ❤️ 1
    less?
    RealLiuSha
        4
    RealLiuSha  
       Apr 27, 2017   ❤️ 1
    for line in `find ./ -type f |xargs -n1`; do echo $line; read -rsp $'Press any key or wait 5 seconds to continue...\n' -n 1 -t 5; done;

    你看这样行不行
    likaci
        5
    likaci  
       Apr 27, 2017   ❤️ 1
    | less
    | vim -
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1330 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 17:04 · PVG 01:04 · LAX 10:04 · JFK 13:04
    ♥ Do have faith in what you're doing.