Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminal - current directory symbol [closed]

Is there a symbol for the current directory?

For example instead of type the full path name for the current directory, e.g.:

cp /User/Name/f1/f2/ /User/Name/f3/f4/f5

where /User/Name/f1/f2/ is the current directory.

Is there any symbol that acts as pwd?

like image 696
Soubriquet Avatar asked Nov 29 '14 17:11

Soubriquet


1 Answers

Simply a . will act as the current working directory in bash

In this example you give

cp . /User/Name/f3/f4/f5

To note: this will not work, cp will need the -r parameter for copying directories

cp -r . /User/Name/f3/f4/f5

The current working directory can also be fetched with the pwd command, used as $(pwd) instead of . in this command

like image 91
foips Avatar answered Oct 15 '22 04:10

foips