LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


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

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


Hi,

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.

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

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
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
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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
jsteel
Member
 
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
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:20 AM.

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