Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-20-2011, 05:28 PM   #1
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Rep: Reputation: 34
Find current Thunar directory from CLI?


Is it possible to find out the directory Thunar is currently displaying from the command line? I will only have one instance of Thunar open at one time.

Old 04-20-2011, 06:45 PM   #2
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
You would think so. I just tried this with Nautilus on Ubuntu 10.04. Maybe you will see something useful in this experiment.

First I started nautilus.

Second I started a terminal window under the same user account.

Third I issued the pidof nautilus command. That returned a PID.

Fourth I issued a ls -lh /proc/<pid> where <pid> is the number that was returned from the pidof nautilus command.

That showed a link named cwd, which I took to mean "current working directory". That link pointed to my home directory.

Fifth I changed the directory showing in the Nautilus window and issued the ls -lh /proc/<pid> again.

The cwd link did not change value.

Sixth I issued the cat /proc/<pid>/environ command and looked for PWD. That also showed the home directory, not the directory showing in the Nautilus window.

I am very surprised by the result.
Old 04-20-2011, 07:21 PM   #3
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
I just tried the same thing (well, a little differently) using Thunar in a Xfce4 session under Fedora with the same result: CWD is just the home directory. I even tried starting Thunar from a terminal after changing the working directory, but the Thunar process is started (by default) with the --daemon option, so a new window (which opens in the cwd of the terminal) still has the CWD= value in the /proc/####/eniron file (and the /proc/####/cwd symbolic link) set to $HOME, not $CWD.

Strange, eh?
Old 04-21-2011, 02:05 AM   #4
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Original Poster
Rep: Reputation: 34
Thanks for that suggestion. I too have it point to my home directory no matter where I browse to


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to find a string in files under the current directory? thomas2004ch Linux - Newbie 4 10-05-2010 06:41 AM
[SOLVED] How to find files under the current directory? thomas2004ch Linux - Newbie 2 10-05-2010 05:19 AM
find lists current directory kaprasanna Linux - General 3 12-17-2007 04:06 AM
find in current directory ramanadyv Linux - Newbie 3 03-28-2006 10:12 PM
how do I find out the current working directory? nodger Programming 2 12-26-2004 11:28 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration