the "find" command in terminal has gotten blind?

If you think I am going to go through 80 of them to find out ... dream on ;)
On and
So eight into 80 goes 10, so, Beef, I may have 10 that don't. Guessing.
MATE always has it (amongst mine), Xfce usually, and GNOME has it after you install a package called
nautilus-admin
Nautilus is the name for GNOME's FM (file manager) usually known as Files.
KDE's Dolphin FM had it, then removed it, then brought it back, and then removed it again. There is often an extension or two for Dolphin that say they can enable it, but quite often they do not work.
Wiz
I used the regular Debian 11 installer, downloaded from Debian.org. I booted it and performed the same installation. The ONLY difference was choosing different desktop managers in the tasksel menu during installation.

My goal at the time was to look at different desktop managers to understand them better from a remote access point of view. It didn't take long to install Debian on eight different virtual machines. When I was done, I put them in a folder and compressed it in case I needed it again.

It took only a few minutes to restore them and test the Debian folder right-click menus for the post above.

I cannot explain why some implementations of MATE (Ubuntu MATE 22.04 and @wizardfromoz' distros) have the Open in Terminal menu item while the MATE from the Debian 11 installer does not.
 


Off the top of my head:
Bash:
 cd $(dirname $(find ./ -type f -iname "vintagestory.exe") )
Or perhaps:
Bash:
find ./ -type f -iname "vintagestory.exe" -exec cd $(dirname {} ) \;

I’m nowhere near my PC to test those, but hopefully one of them will work!!

** Edit - BTW: Those commands are only going to work properly (if they even work at all) if you know for certain that there’s only going to be one result. **
I've since tested those two commands.
The first command works properly. It will find the file and then cd into the directory containing it.
The second command does not work. Find's -exec option doesn't let you use the file placeholder in a command in a sub-shell.

So ignore the second command. That doesn't work at all!

If you want to find a file and then cd into the directory containing it, use the following:
Bash:
cd $(dirname $(find ./ -type f -iname "vintagestory.exe") )

But it will only work as expected if you only have a single file with that name.
If you have more than one result, cd will complain about having too many arguments.
 
I've since tested those two commands.
...
Yeah I get that. But put yourself in a position of a scrub that can barely differentiate between the left and right mouse button.

He will just melt down trying to engage that code. The chance of them running into a problem or returning a sub-optimal result skyrockets. Things that seem second nature to us will be on the level of medieval witchcraft to that poor confused boyo trying to get it to run.

Better make a 3 step process that is understandable rather than a 2 step one where he is copying code for half of which he doesn't know what to do.
find . -name Filename
cd to/search/results
-argument RunAppCommand
is easily understandable for a beginner, while
cd $(dirname $(find ./ -type f -iname "filename.type") )
isn't.

All linux communities strongly encourage not just blindly pasting any code they find on the internet for security reasons, and for someone who is not knowledgeable but is paying attention, wil go dissecting the code for its meaning. I don't want that...


By the way, I tested
mesa_glthread=true mono $(dirname $(find ./ -type f -iname "Vintagestory.exe") )
Returns
File does not contain valid CIL image
Curious. If that one single command would have worked, it would have been awesome AF! But I would still post a 3-step process... because BEGINNER FRIENDLY!
 
Yeah I get that. But put yourself in a position of a scrub that can barely differentiate between the left and right mouse button.

He will just melt down trying to engage that code. The chance of them running into a problem or returning a sub-optimal result skyrockets. Things that seem second nature to us will be on the level of medieval witchcraft to that poor confused boyo trying to get it to run.

Better make a 3 step process that is understandable rather than a 2 step one where he is copying code for half of which he doesn't know what to do.



is easily understandable for a beginner, while

isn't.

All linux communities strongly encourage not just blindly pasting any code they find on the internet for security reasons, and for someone who is not knowledgeable but is paying attention, wil go dissecting the code for its meaning. I don't want that...


By the way, I tested

Returns

Curious. If that one single command would have worked, it would have been awesome AF! But I would still post a 3-step process... because BEGINNER FRIENDLY!
Fair enough!
You initially asked for a solution that would allow you to find the file and open the directory containing it, without having to manually type the really long path to the file. My solution does exactly what you asked. It finds the file, gets the path of the directory containing the file and then cds into the directory.

WRT this:
Bash:
mesa_glthread=true mono $(dirname $(find ./ -type f -iname "Vintagestory.exe") )

That would translate to:
Bash:
mesa_glthread=true mono /path/to/

Where /path/to is the path to the directory containing Vintagestory.exe.

I imagine you’d need to cd into the directory containing the file, then run the file in Mono:
E.g.
Bash:
cd $(dirname $(find ./ -type f -iname "vintagestory.exe") ); mesa_glthread=true; mono ./vintagestory.exe; cd -

That will cd into the directory containing the .exe. Set the environment variable. Run the executable in Mono and then cd back to the directory you were originally in.
 
The following is off topic so if we have any more content on the matter, we'll have to take it to a new Thread.

@sphen

I cannot explain why some implementations of MATE (Ubuntu MATE 22.04 and @wizardfromoz' distros) have the Open in Terminal menu item while the MATE from the Debian 11 installer does not.

Installed on drive Debian 11 MATE, ended up installing

caja-admin

to get open as administrator, and while in Synaptic found

caja-open-terminal

Added that as well, now Caja will open folders in terminal. The extension went to live with 3 other files in

/usr/share/caja/extensions

Also found this is you want to tweak the icons

https://ubuntugenius.wordpress.com/...n-for-open-in-terminal-in-mates-file-manager/

Cheers

Wiz
 
That will cd into the directory containing the .exe. Set the environment variable. Run the executable in Mono and then cd back to the directory you were originally in.
Nice! I can see the necessary code forming for a script now. However, in my case, all scripted commands can only be performed as sudo. The unfortunate thing with that is that the game in question is pretty finicky. Just setting the environment variable causes it to longer recognize its listed default location of the game's data, which means it creates another one.
Visual Result.png

Don't mind the red arrow, rather direct your attention to yellow output text, this image is part of the guide in question I posted...

For all intents and purposes it created another set of folder containing game data as for reason, no longer being able to see the default one. For me its no problem, since I just ported all the data from the old folder to the new. I posted this for visual reference.

Running the same argument as sudo, for example a necessity on my distro if I want to run a bash script, will lose access to the game data folder of both previous instances, and would need to port the data AGAIN. If I were a complete beginner, I would be at the brink of a seizure at this point!o_O
 
Regarding the missing assemblies, they are .NET libraries, or .NET executables that can’t be found. So perhaps there is a library path that needs to be set somewhere? IDK.

I haven’t messed with C# or .NET for donkeys years!

Off the top of my head, it may be that you need to cd into the directory containing all of the game data (whichever directory contains the correctly populated Lib and Mod sub-directories) and then run the executable from there?! I honestly don’t know!

But from the rest of the messages in white, it looks like the game is starting up….
 
Regarding the missing assemblies, they are .NET libraries, or .NET executables that can’t be found. So perhaps there is a library path that needs to be set somewhere? IDK.

I haven’t messed with C# or .NET for donkeys years!

Off the top of my head, it may be that you need to cd into the directory containing all of the game data (whichever directory contains the correctly populated Lib and Mod sub-directories) and then run the executable from there?! I honestly don’t know!

But from the rest of the messages in white, it looks like the game is starting up….
Oh yes, it works perfectly fine. The only thing gone from the difference between running regularly and running it under the argument is that it is unable to read user data from the default folder, thus it creates another set of its own. I simply ported the settings and saves into the new set of folders and that was that.
 

Members online


Latest posts

Top