
history
我正在伺服器上查看,看到我的同事view
在文件上使用了該命令。
據我所知,它會查看您的文件$EDITOR
,然後用它打開該文件。
我想更多地了解它是如何工作的,但事實證明這很困難。使用man
or info
onview
只是返回您的$EDITOR
.沒有help
頁面,谷歌搜尋顯然很困難。
任何想法?
答案1
使用man view
其中一個會定向到 的手冊頁vim
。在裡面我發現了這個:
view Start in read-only mode. You will be protected from writing the files. Can also be done with the "-R" argument.
答案2
我發現我的系統上的答案很有趣。從...開始:
type view
view is /usr/bin/view
那麼,那是什麼?
file /usr/bin/view
/usr/bin/view: symbolic link to /etc/alternatives/view
file /etc/alternatives/view
/etc/alternatives/view: symbolic link to /usr/bin/vim.basic
所以,最終(至少在基於 Ubuntu 的系統上),它是一個由update-alternatives
.
update-alternatives --config view
There are 2 choices for the alternative view (providing /usr/bin/view).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/vim.basic 30 auto mode
1 /usr/bin/vim.basic 30 manual mode
2 /usr/bin/vim.tiny 10 manual mode
Press <enter> to keep the current choice[*], or type selection number: