After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 632427 - add command line option to select file
add command line option to select file
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 131259 647204 647652 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-10-18 04:15 UTC by deters
Modified: 2011-06-27 20:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Added a --select option to open nautilus and select a file given an URI (2.85 KB, patch)
2010-11-07 17:53 UTC, deters
none Details | Review
Added a --select option to open nautilus and select the given files (2.98 KB, patch)
2010-11-07 20:32 UTC, deters
none Details | Review

Description deters 2010-10-18 04:15:52 UTC
From another user wish at Launchpad:

'''
When I click "open in folder" in mozilla firefox download window, for example, i expect nautilus that will open folder with downloaded file AND select downloaded file. But i have only open folder.
so i propose add command line to nautilus to select file
'''


And NO, this bug is NOT related to using DBUS to select files... it's a simple command line option, like this:

nautilus --select /home/deters/Downloads/somefile.avi

or this:

nautilus --select *.avi /home/deters/Downloads


Nautilus already can do this by using the "Selection" dialog (Ctrl+S)... why can't do it from the command line?
Comment 1 deters 2010-11-07 17:53:44 UTC
Created attachment 173993 [details] [review]
Added a --select option to open nautilus and select a file given an URI

Usage:

nautilus --select "file:///home/deters/file.txt" /home/deters
Comment 2 deters 2010-11-07 20:32:30 UTC
Created attachment 174023 [details] [review]
Added a --select option to open nautilus and select the given files

Usage (one window for each selected file): 

nautilus --select ~/some_file.txt ~/another_file_to_be_selected.txt
Comment 3 Cosimo Cecchi 2011-04-08 19:51:23 UTC
*** Bug 647204 has been marked as a duplicate of this bug. ***
Comment 4 Cosimo Cecchi 2011-04-08 21:41:47 UTC
deters: thanks for the patch; however, adding a new command line switch there is not the right thing to do. Instead, path/uris pointing to a file should just open the parent directory and select that file. I pushed a fix to git master that does this.

Closing as FIXED.
Comment 5 deters 2011-04-08 23:15:39 UTC
The "--select" switch came from dolphin... 

But your solution is very elegant!!! and needs only 20 lines! 

Next step: fill bug reports at firefox and chrome to call nautilus with complete path (including filename)   :)

Thank you!!
Comment 6 Cosimo Cecchi 2011-04-13 21:04:59 UTC
*** Bug 647652 has been marked as a duplicate of this bug. ***
Comment 7 Cosimo Cecchi 2011-06-27 20:13:33 UTC
*** Bug 131259 has been marked as a duplicate of this bug. ***