Copy Current Directory Path From Terminal

Gobinath Loganathan
Cognitio
Published in
1 min readJun 4, 2016

Copying the current path of Terminal is an essential task for a developer. The copied path may be pasted in to the IDE to open the project or in a new tab of an existing File explorer. What we need is a way to copy the current path into the clipboard. copythis script can make this task easy.

Note: Most of the commands given in this post will deploy the scripts in ~/bin directory. Make sure that you have such a directory in your system.

Step 1: Install necessary dependencies

sudo apt-get install xclip

Step 2: Deploy copythis script and make it executable

wget https://raw.githubusercontent.com/slgobinath/ubuntu-tweaks/master/copythis/copythis --output-document ~/bin/copythis && chmod +x ~/bin/copythis

Step 3:

From any terminals, just type copythis and hit the enter

Open your text editor and press Ctrl + V (or any other ways of pasting)

Find the script @ GitHub: copythis

--

--