有時候手殘會發生這種事
原本想要打這樣:
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. 把"改檔名"和"重作動作"兩個動作變成一個動作, 而且指令不會太長?
--
原本想要打這樣:
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. 把"改檔名"和"重作動作"兩個動作變成一個動作, 而且指令不會太長?
--
All Comments