How to Find out a GNU Screen Window’s Default Directory

gnu-screenworking directory

Question

How do I find out the default directory of a window in GNU screen?

NB: I’m not looking for the current directory of the process running in the window.

Background

I have created a hardcopy of my scrollback buffer without giving an absolute path. Now I don’t know where to find the created file. I don’t remeber from which directory I have originally invoked screen and I haven’t used any chdir command.

I’m now wondering which directory I have polluted with my hardcopy … :-\

Best Answer

The easiest is probably to just make a new window, it will start in the directory where screen was started by default.

Alternatives include looking at the process' cwd (e.g. /proc/<pid>/cwd, but this requires root as screen is setuid)

Note that you can change that directory with C-a :chdir <path> later

Related Question