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

Shell(终端)中根据关键词找到上一次输入的命令?

  •  
  •   konakona · Apr 4, 2014 · 4171 views
    This topic created in 4418 days ago, the information mentioned may be changed or developed.
    是酱汁的,我在几天前输入了"zip ... " 的压缩命令(为了将mac下一些隐藏文件排除的压缩命令),但我记不清,又不想去百度了(这种需求还挺多的,呵呵)
    有什么办法根据我输入的开头几个字“zip” 然后找到我上一次输入这条命令时的完整命令呢?
    10 replies    1970-01-01 08:00:00 +08:00
    halfbloodrock
        1
    halfbloodrock  
       Apr 4, 2014
    ctrl + r
    lsj5031
        2
    lsj5031  
       Apr 4, 2014
    history | grep
    jedyu
        3
    jedyu  
       Apr 4, 2014
    history | grep zip
    lang1pal
        4
    lang1pal  
       Apr 4, 2014
    page up && page down
    fangzhzh
        5
    fangzhzh  
       Apr 4, 2014 via Android
    ctrl r 命令
    ceclinux
        6
    ceclinux  
       Apr 4, 2014
    oh-my-zsh 好像默认输入zip 按page up ,page down即可
    jiyinyiyong
        7
    jiyinyiyong  
       Apr 4, 2014
    ```
    ➤➤ cat ~/.inputrc

    "\e[A":history-search-backward
    "\e[B":history-search-forward

    set show-all-if-ambiguous on
    set completion-ignore-case on
    ```
    hackevin
        8
    hackevin  
       Apr 4, 2014
    esc /zip
    dun2
        9
    dun2  
       Apr 5, 2014   ❤️ 1
    zfs是王道
    diseng1991
        10
    diseng1991  
       Apr 6, 2014   ❤️ 1
    ctrl+r 搜索 *nux通用

    zip+上键 zsh可用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1823 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 997ms · UTC 16:17 · PVG 00:17 · LAX 09:17 · JFK 12:17
    ♥ Do have faith in what you're doing.