mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-29 21:41:00 +08:00
140 lines
6.4 KiB
Markdown
140 lines
6.4 KiB
Markdown
[#]: subject: "Mix and Match Terminal With Nautilus File Manager in Linux"
|
|
[#]: via: "https://itsfoss.com/terminal-nautilus-combination/"
|
|
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
|
[#]: collector: "lkxed"
|
|
[#]: translator: " "
|
|
[#]: reviewer: " "
|
|
[#]: publisher: " "
|
|
[#]: url: " "
|
|
|
|
Mix and Match Terminal With Nautilus File Manager in Linux
|
|
======
|
|
|
|
Nautilus is the graphical file browser in the GNOME desktop. You use it for accessing and managing files and folders on your system.
|
|
|
|
You can also manage files and directories from the terminal though not everyone prefers that.
|
|
|
|
However, you may encounter situations where you have to switch between the terminal and file manager.
|
|
|
|
There are various ways to interact between the Nautilus file manager and terminal. Surprisingly, not many Linux users know about them.
|
|
|
|
**_For example, in Nautilus, right-click and choose 'Open in terminal' option and you'll open the current directory location in the terminal._**
|
|
|
|
![Open terminal from Nautilus file manager in Linux][1]
|
|
|
|
That's just one of the many examples I am going to share with you in this article.
|
|
|
|
### 1. Drag and drop to get the absolute path
|
|
|
|
If you drag and drop a folder or a file to a terminal, its absolute path will be pasted on the terminal screen.
|
|
|
|
![Dragging and Dropping a File or Folder from Nautilus to Terminal will paste tha absolute path of that item][2]
|
|
|
|
This helps when you are deep inside the directory structure in the file browser and don't want to type the entire path in the terminal.
|
|
|
|
### 2. Enter a directory
|
|
|
|
It's similar to what you saw above. If you are deep inside the directory structure and don't want to type the entire path for [switching to the directory][3], this trick helps.
|
|
|
|
Type the [cd command][4] in the terminal and then drag and drop to enter into the directory.
|
|
|
|
![Enter to a directory by Drag and Drop that directory to the terminal after a "cd" command][5]
|
|
|
|
### 3. Open a file in editor
|
|
|
|
Similarly, you can open a file for [editing with Nano][6] or Vim editor.
|
|
|
|
Drag and drop a file to `nano` command to open it for editing.
|
|
|
|
![After typing "nano", drag and drop the file you need to edit to the terminal][7]
|
|
|
|
### 4. Open a file for editing with sudo
|
|
|
|
Same as above but this time, you open the file for editing with sudo access.
|
|
|
|
![Open the sources list file in nano with sudo privileges.][8]
|
|
|
|
### 5. Drag multiple files, if the command supports multiple arguments
|
|
|
|
You can also drag and drop multiple files to get their absolute paths. This can be used with commands that accept more than one argument.
|
|
|
|
For example, the [diff command checks the difference between two files][9]. Enter `diff` and then drag and drop the files you want to check for differences.
|
|
|
|
![Check the difference in two files by selecting both files and then drag and drop them as diff command arguments][10]
|
|
|
|
### 6. Copy and paste from text files
|
|
|
|
Reading a document and have to run a command mentioned in it? You can of course [copy paste in the terminal][11].
|
|
|
|
However, a quicker way is to select the text and drag and drop it to the terminal.
|
|
|
|
This trick works with [GNOME-Sushi][12] preview as well.
|
|
|
|
![Drag and Drop some text from any file from its overview using GNOME-Sushi][13]
|
|
|
|
### 7. Drag and drop from browser
|
|
|
|
Like the text files above, you can also drag and drop text from browsers. This helps in following tutorials while doing it at the same time.
|
|
|
|
![Drag and Drop codes or URLs from internet to the terminal without copy or paste][14]
|
|
|
|
### 8. Embed terminal in Nautilus
|
|
|
|
Can't live without the terminal? Embed it directly in the file manager. This way you don't have to [open a terminal][15] separately.
|
|
|
|
The thing here is that if you switch to another directory in the file browser, it automatically switches the directly in the embedded terminal also.
|
|
|
|
You can perform most of the above-mentioned drag and drop operations in the Nautilus embedded terminal also. For example, search for a specific text in bashrc, by dropping the `.bashrc` file and using grep.
|
|
|
|
![Search for a specific text in bashrc, by dropping the .bashrc file in the embedded terminal and using grep][16]
|
|
|
|
### 9. Drag files between tabs of the embedded terminal
|
|
|
|
Both terminal and file manager supports the tabbed view. You can drag and drop files from one tab to another.
|
|
|
|
For example, to [check the shasum][17] value for an ISO, enter shasum command, then, drag and drop the file from another tab, as shown below.
|
|
|
|
![Check the shasum value for an ISO, enter shasum command, then, drag and drop the file from another tab][18]
|
|
|
|
### More on Nautilus and terminal
|
|
|
|
Liked these tips? Maybe you would want to learn more such tips.
|
|
|
|
If you want to get more out of the Nautilus file manager, here are a few tips for you.
|
|
|
|
Here are some terminal tips to explore.
|
|
|
|
💬 _Do you know any other such cool tip that combines the terminal and the file manager? Why not share it with us in the comment section below?_
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
via: https://itsfoss.com/terminal-nautilus-combination/
|
|
|
|
作者:[Abhishek Prakash][a]
|
|
选题:[lkxed][b]
|
|
译者:[译者ID](https://github.com/译者ID)
|
|
校对:[校对者ID](https://github.com/校对者ID)
|
|
|
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
|
|
[a]: https://itsfoss.com/author/abhishek/
|
|
[b]: https://github.com/lkxed/
|
|
[1]: https://itsfoss.com/content/images/2023/07/right-click-open-in-terminal.gif
|
|
[2]: https://itsfoss.com/content/images/2023/07/copies-absolute-path.gif
|
|
[3]: https://itsfoss.com/change-directories/
|
|
[4]: https://itsfoss.com/cd-command/
|
|
[5]: https://itsfoss.com/content/images/2023/07/enter-a-directory.gif
|
|
[6]: https://itsfoss.com/nano-editor-guide/
|
|
[7]: https://itsfoss.com/content/images/2023/07/edit-bashrc.gif
|
|
[8]: https://itsfoss.com/content/images/2023/07/open-sources.gif
|
|
[9]: https://linuxhandbook.com/diff-command/
|
|
[10]: https://itsfoss.com/content/images/2023/07/check-diff.gif
|
|
[11]: https://itsfoss.com/copy-paste-linux-terminal/
|
|
[12]: https://gitlab.gnome.org/GNOME/sushi
|
|
[13]: https://itsfoss.com/content/images/2023/07/from-sushi.gif
|
|
[14]: https://itsfoss.com/content/images/2023/07/drag-and-drop-code-from-internet.gif
|
|
[15]: https://itsfoss.com/open-terminal-ubuntu/
|
|
[16]: https://itsfoss.com/content/images/2023/07/embedded-terminal.gif
|
|
[17]: https://itsfoss.com/checksum-tools-guide-linux/
|
|
[18]: https://itsfoss.com/content/images/2023/07/shasum-final.gif
|