Mix and Match Terminal With Nautilus File Manager in Linux

Here are a few tips and tweaks to save your time by combining the terminal and the 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

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
Copies Absolute Path

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, this trick helps.

Type the cd command 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
Enter a Directory

3. Open a file in editor

Similarly, you can open a file for editing with Nano 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
Edit a File

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.
Open files with sudo privileges

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. 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
Check Difference

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.

However, a quicker way is to select the text and drag and drop it to the terminal.

This trick works with GNOME-Sushi preview as well.

Drag and Drop some text from any file from its overview using GNOME-Sushi
Drag and Drop from gnome-sushi

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
Drag and drop from internet

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 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
Using Embedded Terminal

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 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
Drag and Drop from multiple tabs in Nautilus

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.

13 Ways to Tweak Nautilus File Manager in LinuxNautilus, aka GNOME Files, is a good file manager with plenty of features. You can further enhance your experience by using these extensions, tweaks and tips.

Here are some terminal tips to explore.

19 Basic But Essential Linux Terminal Tips You Must KnowLearn some small, basic but often ignored things about the terminal. With the small tips, you should be able to use the terminal with slightly more efficiency.

đź’¬ 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?