Skip to content
Advertisement

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?

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement