Home FAQ Drag And Drop Files And Folders In Terminal To Print Their Absolute Path
Drag And Drop Files And Folders In Terminal To Print Their Absolute Path

Drag And Drop Files And Folders In Terminal To Print Their Absolute Path

By sk
1049 Views

Did you know you can simply drag and drop files and folders in terminal to print their absolute path? No? No problem! This quick tip will teach you how to quickly paste the actual path of a file or a folder in Terminal by drag and drop in Linux and Unix-like systems.

Let us say, you want to run an executable script stored somewhere in your Linux system. You can do it from command line in three ways. Move the script to your $PATH, so you can run it directly using its name. Secondly, just go to the location where you saved the script and run it. Thirdly, you can run it from anywhere by specifying its absolute path, something like path/to/the/script.

For instance, I was testing Sysmon program yesterday. At present, I launch it every time using its full path like this - python sysmon/src/sysmon.py. It is just an example. You might often have to type the absolute path of a file or folder in the Terminal for any reason. Instead of typing the whole path manually each time, you can simply use the built-in drag and drop mechanism to print the full path of a file or folder in Terminal as shown below.

Drag And Drop Files And Folders In Terminal To Print Their Absolute Path

To print the absolute path of a file or folder in the Terminal, just drag and drop them inside the Terminal window. The full path of the dragged will instantly appear.

Print absolute path of a file by drag and drop:

Drag and drop files in Terminal to print their absolute path
Drag and drop files in Terminal to print their absolute path

Print absolute path of a folder by drag and drop:

Drag and drop folders in Terminal to print their absolute path

Here is a short visual demo.

Drag And Drop Files And Folders In Terminal To Print Their Absolute Path

It's quite handy, isn't? No need to type the long path over and over. Just drag and drop the files or folders to paste their absolute path instantly in the Terminal. Hope it was useful to you too.

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More