如何從終端開啟Ubuntu Nautilus檔案瀏覽器
Recently, we showed you how to open a directory in Terminal from within Nautilus. However, what if you’re working on the command line in Terminal and need to access the same directory in Nautilus? There’s an easy solution for that.
最近,我們向您展示瞭如何從Nautilus中在Terminal中開啟目錄。 但是,如果您在終端中的命令列上工作並且需要訪問Nautilus中的相同目錄怎麼辦? 有一個簡單的解決方案。
NOTE: When we say to type something in this article and there are quotes around the text, DO NOT type the quotes, unless we specify otherwise.
注意:當我們說要在本文中鍵入某些內容並且文本週圍有引號時,請不要鍵入引號,除非我們另外指定。
To open the current directory open in Terminal, type the following command at the prompt and press Enter.
要開啟在Terminal中開啟的當前目錄,請在提示符下鍵入以下命令,然後按Enter。
nautilus .
鸚鵡螺。
NOTE: Be sure to type a space between “nautilus” and the period (“.”).
注意:請確保在“鸚鵡螺”和句點(“。”)之間鍵入一個空格。
It doesn’t matter which directory is active in Terminal before jumping to a specific directory in Nautilus.
跳轉到Nautilus中的特定目錄之前,在終端中處於活動狀態的目錄都沒有關係。
Nautilus opens directly to the specified directory.
Nautilus將直接開啟到指定目錄。
You can easily jump to other directories in Nautilus, such as your Home directory…
您可以輕鬆跳轉到Nautilus中的其他目錄,例如主目錄…
…or your Music directory. You can also jump to other directories within your Home directory, such as Documents (nautilus ~/Documents), pictures (nautilus ~/Pictures), or Downloads (nautilus ~/Downloads).
…或您的音樂目錄。 您還可以跳到主目錄中的其他目錄,例如文件(nautilus〜/ Documents),圖片(nautilus〜/ Pictures)或下載(nautilus〜/ Downloads)。
Jumping to directories you created are just as easy. Note that for directory names that contain spaces, preface each space with a backslash (\).
跳轉到您建立的目錄同樣簡單。 請注意,對於包含空格的目錄名稱,請在每個空格前加反斜槓(\)。
If there are certain directories you access a lot, you can create aliases, or shortcuts, to access those directories in Nautilus from Terminal. For example, you can create the following alias so you can simply type “nh” to access your Home directory in Nautilus.
如果您經常訪問某些目錄,則可以建立別名或快捷方式,以從Terminal在Nautilus中訪問這些目錄。 例如,您可以建立以下別名,因此只需鍵入“ nh”即可訪問Nautilus中的主目錄。
alias nh=’nautilus .’
別名nh ='nautilus。'
See our article to learn how to create and use aliases to customize Ubuntu commands.
請參閱我們的文章,以瞭解如何建立和使用別名來自定義Ubuntu命令。
Then, on the command line in Terminal, you can type “nh” from any directory to jump to your Home directory in Nautilus.
然後,在終端的命令列上,可以從任何目錄鍵入“ nh”以跳轉到Nautilus中的主目錄。
To close the Terminal window, type “exit” at the prompt and press Enter, or click the X button in the upper-left corner of the window.
要關閉“終端”視窗,請在提示符下鍵入“ exit”,然後按Enter,或單擊視窗左上角的X按鈕。
You can also create a bash shell script containing the “nautilus .” command. This allows you to press Alt + F2 to access the command bar from Unity, type “nh” (or whatever filename you assigned to the script), and press Enter, to open your Home directory without ever opening a Terminal window.
您還可以建立一個包含“ nautilus”的bash shell指令碼。 命令。 這樣,您可以按Alt + F2從Unity訪問命令欄,鍵入“ nh”(或您分配給指令碼的任何檔名),然後按Enter鍵開啟主目錄,而無需開啟終端視窗。
NOTE: You can also click on the resulting icon for your script to run it.
注意:您也可以單擊指令碼的結果圖示以執行它。
See our Beginner’s Guide to Shell Scripting series to learn how to create shell scripts.
請參閱我們的《 Shell指令碼入門指南》系列,以瞭解如何建立Shell指令碼。
If you’re already in Nautilus and you need to move to a different directory, you can use the keyboard to get there if you show the location entry instead of the breadcrumb bar.
如果您已經在Nautilus中,並且需要移動到其他目錄,則在顯示位置條目而不是麵包屑欄時,可以使用鍵盤到達那裡。
翻譯自: https://www.howtogeek.com/193071/how-to-open-the-ubuntu-nautilus-file-browser-from-the-terminal/