Start typing to search...

Searching for "{{search_term}}"

Search results for "{{search_term}}"

Oops! Nothing found based on your query.

 
{{auth_form.errors}}

No account found with this email address. Fill out this form to create an account.

 

How-To: Copy current directory path in Terminal

Posted on July 2, 2017 by Mohit Aneja in How-Tos, Mac, Terminal.

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 the commandpwd 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.