[問題] 誤改檔名後如何快速改回來
有時候手殘會發生這種事
原本想要打這樣:
user@local_host:~$ scp a_file_with_long_filename user@remote_host:path_to_put_the_file
卻不小心打成這樣, 誤改了檔名:
user@local_host:~$ mv a_file_with_long_filename user@remote_host:path_to_put_the_file
於是只好先把檔名改回來再scp:
user@local_host:~$ mv user@remote_host:path_to_put_the_file a_file_with_long_filename
user@local_host:~$ scp a_file_with_long_filename user@remote_host:path_to_put_the_file
像這種情況就算有tab completion的幫忙也是略嫌麻煩
以上情境只是舉例 也有其他情況也是不小心改了檔名
想請問的是像這種情況有沒有辦法:
1. 用更短的指令把檔名改回來
or
2. 把"改檔名"和"重作動作"兩個動作變成一個動作, 而且指令不會太長?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.31.149
推
09/20 16:24, , 1F
09/20 16:24, 1F
我的.bashrc有alias mv='mv -i'
然而mv -i 是覆寫前提出警告 跟我問的問題的關係是...?
→
09/20 16:25, , 2F
09/20 16:25, 2F
喔我懂你的意思了 你是說每次mv都跳出prompt對吧
不過mv -i只有覆寫才有prompt 然後我也不希望每次mv都prompt...XD
推
09/20 16:26, , 3F
09/20 16:26, 3F
推
09/20 16:34, , 4F
09/20 16:34, 4F
推
09/20 21:59, , 5F
09/20 21:59, 5F
推
09/20 22:20, , 6F
09/20 22:20, 6F
說到滑鼠中鍵選取
我超希望用鍵盤就可以操作primary selection或clipboard
比如(幻想)按ESC後接^w就可以把cursor右方的word複製到primary selection
可惜bash好像沒有這種功能 = =
→
09/20 23:27, , 7F
09/20 23:27, 7F
恩恩!剛剛還在研究XD 這應該是本文最佳解法了
推
09/21 00:53, , 8F
09/21 00:53, 8F
多謝!
→
09/21 00:57, , 9F
09/21 00:57, 9F
→
09/21 00:57, , 10F
09/21 00:57, 10F
喔喔...我本來以為set -o vi只是改key binding而已 原來有那些功能?
來研究看看...
推
09/21 01:50, , 11F
09/21 01:50, 11F
恩恩
※ 編輯: Holocaust123 來自: 140.112.31.155 (09/21 02:25)