Micky
V2EX  ›  问与答

求助!ssh远程命令,子目录太多,如何只列出其中一部分?

  •  
  •   Micky · Apr 22, 2013 · 3648 views
    This topic created in 4778 days ago, the information mentioned may be changed or developed.
    如题,图片文件夹下有很多很多的子目录,用ls列出的时候,要好久好久才列举完,有时候还会导致终端假死……
    有没有什么命令,可以只列出比如前10个子目录呢?
    我只是想查看各个子目录下的文件命名规则,没必要全列出来。
    多谢各位大大!
    3 replies    1970-01-01 08:00:00 +08:00
    clino
        1
    clino  
       Apr 22, 2013
    ssh root@server "ls -al dirpath|head -n 10"
    Micky
        2
    Micky  
    OP
       Apr 22, 2013
    @clino 爽!Thax!
    lpisces
        3
    lpisces  
       Apr 22, 2013
    ls -al | more
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3023 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:19 · PVG 15:19 · LAX 00:19 · JFK 03:19
    ♥ Do have faith in what you're doing.