Thursday, May 2, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 458  / 3 Years ago, thu, june 24, 2021, 4:19:36

I am new to using the terminal in Ubuntu and I was wondering how I could open the file "armored.jpg" as I type out the whole path.



For instance, if I type cd ~/Pictures/Wallpapers/test x/ and then type xdg-open armored.jpg in the current directory it opens the picture.



However when I type:



cd ~/Pictures/Wallpapers/test x/ xdg-open armored.jpg


or



cd ~/Pictures/Wallpapers/test x/armored.jpg


or



cd ~/Pictures/Wallpapers/test x/armored


it does not work.



Can anyone explain why this is? I want to know if I can open the file with something like this:



cd ~/Pictures/Wallpapers/test x/**command goes here**/armored.jpg


Thanks


More From » command-line

 Answers
0

You can do this:



xdg-open ~/Pictures/Wallpapers/test x/armored.jpg



cd means change directory so essentially terminal is expecting a path-to-directory where you want to change to.



xdg-open opens a file in default applications but as it opens a file it expects path-to-file, you can also use xdg-open to open directory in nautilus(if it is your default file manager) in GUI.


[#25771] Saturday, June 26, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fulpu

Total Points: 116
Total Questions: 118
Total Answers: 104

Location: Solomon Islands
Member since Fri, Oct 8, 2021
3 Years ago
;