本文主要是介紹Iterm2的小工具:命令行中查看圖片+一鍵下載遠程圖片,希望對大家解決編程問題提供一定的參考價值,需要的開發(fā)者們隨著小編來一起學習吧!
Iterm2 是一個強大的命令行工具,這里介紹一個有趣的小功能。
程序員做圖片任務的時候,有時希望能查看圖片內(nèi)容,但通常我們是通過命令行連接服務器,難道給服務器安裝一個桌面系統(tǒng)?還是寫一個復雜的腳本下載到本地再查看?iterm 2提供了一個方便的結(jié)局方案。
安裝imgcatimgcat只是iterm 2提供的工具中的一部分,在通過 ssh 登錄到遠端服務器后,點擊iterm2 -> preference -> install shell integration,iterm2 會在遠端服務器安裝相應的組件:
命令行輸出如下:
gpu104: curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed 100 4347 100 4347 0 0 3766 0 0:00:01 0:00:01 --:--:-- 3766 Downloading script from https://iterm2.com/shell_integration/zsh and saving it to /home/kangrong/.iterm2_shell_integration.zsh... Checking if /home/kangrong/.zshrc contains iterm2_shell_integration... Appending source command to /home/kangrong/.zshrc... Downloading imgcat... Downloading imgls... Downloading it2attention... Downloading it2check... Downloading it2copy... Downloading it2dl... ... 使用imgcat
此后,你可以做兩件事情:
第一,通過imgcat直接在iterm2中查看圖片:
第二,鼠標點擊即可下載文件:
這篇關于Iterm2的小工具:命令行中查看圖片+一鍵下載遠程圖片的文章就介紹到這兒,希望我們推薦的文章對編程師們有所幫助!