Sunday, May 5, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2400  / 3 Years ago, tue, november 23, 2021, 8:05:29

I have a Java application in which I need to "reveal" a file to the user (i.e. open the containing folder of the file in an explorer and highlight the file). I have configured it to do so in both Windows and Mac OSX, but I have not been able to find a terminal command to do so on Linux/Ubuntu operating systems.



The below batch/terminal commands are the Windows and Mac equivalents of what I am looking for.



Windows:



Explorer /select,filename


Mac:



open -R filename

More From » command-line

 Answers
0

The file manager in Ubuntu is called Nautilus, and it seems to do what you are after when you pass a file to it on the command line. For instance, the following command:



nautilus ~/Documents/foo.txt


opens a file manager window showing the ~/Documents folder with foo.txt selected.


[#38637] Wednesday, November 24, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rieency

Total Points: 299
Total Questions: 116
Total Answers: 111

Location: Wales
Member since Tue, Dec 14, 2021
2 Years ago
rieency questions
Wed, Aug 25, 21, 15:17, 3 Years ago
Wed, Jun 23, 21, 04:37, 3 Years ago
Fri, Sep 30, 22, 12:07, 2 Years ago
Thu, Feb 24, 22, 00:50, 2 Years ago
Mon, Mar 28, 22, 13:28, 2 Years ago
;