誤改檔名後如何快速改回來 - Linux

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

By Leila
at 2011-09-20T18:40
at 2011-09-20T18:40

By Zenobia
at 2011-09-22T04:06
at 2011-09-22T04:06

By Suhail Hany
at 2011-09-25T14:47
at 2011-09-25T14:47

By Necoo
at 2011-09-28T12:18
at 2011-09-28T12:18

By Margaret
at 2011-10-01T05:16
at 2011-10-01T05:16

By Ivy
at 2011-10-05T10:14
at 2011-10-05T10:14

By Irma
at 2011-10-06T20:37
at 2011-10-06T20:37

By Hedwig
at 2011-10-11T07:34
at 2011-10-11T07:34

By Ingrid
at 2011-10-12T07:24
at 2011-10-12T07:24

By Aaliyah
at 2011-10-16T11:21
at 2011-10-16T11:21
Related Posts
mplayer編譯問題

By Frederic
at 2011-09-20T07:40
at 2011-09-20T07:40
ZIP解壓縮錯誤

By Annie
at 2011-09-19T19:55
at 2011-09-19T19:55
自動化的Wi-Fi連線功能

By Susan
at 2011-09-19T16:02
at 2011-09-19T16:02
星系統社群:第一次星系實戰演練

By Isabella
at 2011-09-19T14:47
at 2011-09-19T14:47
usb檔案無法存取

By Frederica
at 2011-09-19T10:05
at 2011-09-19T10:05