OK

CSSJockey websites use cookies to give you a better user experience on our websites. Visit our Privacy and Cookie policy to get more information about cookies, including how you could opt-out.

How-To: Copy current directory path in Terminal

While working on multiple projects I always need to copy the current path of a directory in Terminal. I used to use th...

published: 2 years ago

While working on multiple projects I always need to copy the current path of a directory in Terminal. I used to use the command pwd in the terminal which prints the current directory path in the terminal and then I have to select the path with the mouse to copy and paste the same where I needed.

I hate to use the mouse as it wastes a lot of time and to save time and copy the current path without selecting it with the mouse, I found this command and use it all the time.

pwd | pbcopy

This command will copy the current directory path to the clipboard and we can then press CMD+V (CTRL+V for Windows) to paste the path wherever needed.

I hope this will help someone saving time and be more productive.

 
 

pre-built solutions

Speed-up the launch of your web projects with our ready-to-use plugins, themes and widgets!

This block enables you to showcase your product or service reviews in an attractive and engaging layout. This block uses...
This block showcases the content from the Team Members menu in the WP Admin. With this block, you can customise the way ...