Open file found with 'find' command in linux

This is probably an easy one, but I can’t figure it out and it’s pretty much not searchable.

on a linux-machine i have installed filezilla

the filezilla runs pretty well and all is ok.

now i need to have the passwd that i have stored years ago. The passprhase is stored in a plain in a file called sitemanager.xmlfile

I want to find that file and open it with a terminal command.

find . -name *.sitemanager

well i thought that this will return the file I’m looking for. Now how do I open it automatically, without typing the name?


find . -name *sitemanager.xm | open

This doesn’t work. It says it doesn’t found the open command.

question: why it does not work on opensuse?

should i use any other command - eg the following:


find . -name *xyz | xargs open 

or

find . -name *sitemanager.xml | xargs open 

or


find . -name *.xyz -exec open {} \; 

and

find . -name *.xyz -exec open {} \; . 

any and all help will be greatly appreciate

again: what is wanted and needet is to find out the passphrase in the filezilla-configuration

Maybe try:


find . -name "*sitemanager.xml" | xargs less

Notes:

  1. You need the quotes. Otherwise the shell sees the “" and expands it. You want that "” to get to the “find” command.
  2. There is no command “open” (as far as I know). There is a command “less” and it is probably on your system. It will allow you to browse the contents of the file(s) found.
find ./ -name "*sitemanager.xml" -exec cat {} \;

hello dear nrikert and miruku

many many thanks for the quick reply


find . -name "*sitemanager.xml" | xargs less

runs nice - but does not open the file


find ./ -name "*sitemanager.xml" -exec cat {} \;

runs but has got no permissions to do any thing with the results

see below


find ./ -name "*sitemanager.xml" -exec cat {} \;
linux-70ce:/ # ls | grep filezilla.xml | xargs open
xargs: open: Datei oder Verzeichnis nicht gefunden
linux-70ce:/ # ls | grep recentservers.xml | xargs open
xargs: open: Datei oder Verzeichnis nicht gefunden
linux-70ce:/ # find ./ -name "*sitemanager.xml" -exec cat {} \;
find: ‘./var/run/user/1000/gvfs’: Keine Berechtigung
find: ‘./run/user/1000/gvfs’: Keine Berechtigung
linux-70ce:/ # 


note keine berechtigung means - no permission
this is very very funny - since i run this command as a superuser ! Isnt this very funny?

well months ago i had a code that was runnng and opening the fine . - with another file that i needed to edit.
the file was opendd in kwrite or kate

but now i have no luck

see another idea like so



find . -name *sitemanager.xml | xargs open gnome-open


but wait - this does not run as well - since i run kde and not (!!!) gnome

do you have any other ideas to get a solution?

any and all help will be greatly appreciated

On 2014-11-30 18:26, dilbertone wrote:

> Code:
> --------------------
>
> find ./ -name “*sitemanager.xml” -exec cat {} ;
> --------------------
>
>
> runs but has got no permissions to do any thing with the results

Well, run the command as a user that does have permission to read that file.

>
>
> see below
>
>
> Code:
> --------------------
>
> find ./ -name “*sitemanager.xml” -exec cat {} ;
> linux-70ce:/ # ls | grep filezilla.xml | xargs open
> xargs: open: Datei oder Verzeichnis nicht gefunden
> --------------------

Just a comment. When the system language is not English, you should do,
in order to post here, like this:


minas-tirith:~ # LANG=C zypper lr --details
....

or this:


minas-tirith:~ # LANG=en_US.UTF-8 zypper info kvm
Loading repository data...
Warning: Repository 'openSUSE-11.4-Update' appears to outdated. Consider
using a different mirror or server.
Reading installed packages...

That way we can all read it, regardless of local languages of sender and
reader. It is not a permanent change, it only applies to one command.

> note keine berechtigung means - no permission
> this is very very funny - since i run this command as a superuser ! Isnt
> this very funny?

Use "ls -l /pathtofile/file to print its permissions and find out why.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

hello dear robin

first of all - many many thanks for the reply and all your hints.
ATM - i am just in a hurry. But i will come back tomorrow and will do more to find what is wrong here.

guess that it has to do with the file (folder) permissions. I think that i have issues to open the file i need to find - the xml-file that contains the passprhase in plain-text.

i did some preliminary steps. see below

./martin/.filezilla/filezilla.xml
./martin/Dokumente/os_systen_update/filezilla_
linux-70ce:/home # 
linux-70ce:/home # minas-tirith:~ # LANG=C zypper lr --details
If 'minas-tirith:~' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf minas-tirith:~
linux-70ce:/home # LANG=C zypper lr --details

# | Alias                        | Name                         | Enabled | Refresh | Priority | Type   | URI                                                                           | Service
--+------------------------------+------------------------------+---------+---------+----------+--------+-------------------------------------------------------------------------------+--------
1 | All_of_Packman               | Packman                      | Yes     | Yes     |   10     | rpm-md | http://packman.inode.at/suse/openSUSE_13.1/                                   |        
2 | M17N                         | M17N                         | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/repositories/M17N/openSUSE_13.1/                 |        
3 | libreoffice                  | libreoffice                  | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/repositories/LibreOffice:/Factory/openSUSE_13.1/ |        
4 | openSUSE 13.1 NON-OSS        | openSUSE 13.1 NON-OSS        | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/13.1/repo/non-oss/                  |        
5 | openSUSE 13.1 NON-OSS Update | openSUSE 13.1 NON-OSS Update | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/13.1-non-oss/                             |        
6 | openSUSE 13.1 OSS            | openSUSE 13.1 OSS            | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/13.1/repo/oss/                      |        
7 | openSUSE 13.1 OSS Update     | openSUSE 13.1 OSS Update     | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/13.1/                                     |        
8 | openSUSE-12.3-1.7            | openSUSE-12.3-1.7            | Yes     | No      |   99     | yast2  | cd:///?devices=/dev/disk/by-id/ata-TEAC-DV-W28S-R,/dev/sr0                    |        
9 | repo-update-non-oss          | openSUSE-13.1-Update-Non-Oss | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/13.1-non-oss/                             |        
linux-70ce:/home # 
linux-70ce:/home # 
linux-70ce:/home # 
linux-70ce:/home # grep Pass ~/.filezilla/filezilla.xml
grep: /root/.filezilla/filezilla.xml: Datei oder Verzeichnis nicht gefunden
linux-70ce:/home # ANG=en_US.UTF-8 zypper info kvm
Metadaten von Repository 'Packman' werden abgerufen ..........................................................[fertig]
Zwischenspeicher für Repository 'Packman' wird erzeugt .......................................................[fertig]
Metadaten von Repository 'M17N' werden abgerufen .............................................................[fertig]
Zwischenspeicher für Repository 'M17N' wird erzeugt ..........................................................[fertig]
Daten des Repositories laden ...
Installierte Pakete lesen ...


Informationen für Paket kvm:
----------------------------
Repository: openSUSE 13.1 OSS Update
Name: kvm
Version: 1.6.0-3.4.1
Arch: i586
Anbieter: openSUSE
Installiert: Nein
Status: nicht installiert
Installierte Größe: 15,4 KiB
Zusammenfassung: Kernel-based Virtual Machine
Beschreibung: 
KVM (Kernel-based Virtual Machine) is virtualization software for
Linux. It was originally developed to leverage the hardware virtualization
extensions provided by Intel VT and AMD-V technologies. Since then, a few
other platforms have also included support for KVM virtualization.

Since the qemu package now supports kvm, this package includes only left-overs
from the former kvm package that for various reasons do not make sense to be
placed in the qemu package.
linux-70ce:/home # 

btw - i also tried out the followning

we ve have to choose which editor we want to open the file in and use the proper command for that editor. For example:


find ./ -name 'blah' -exec vim {} \;

the next step i to tomorrow.


Use "ls -l /pathtofile/file to print its permissions and find out why.

well i guess that this is a key step

i do more tests on this tomorow

untill then

On 2014-11-30 23:56, dilbertone wrote:
>
> hello dear robin
>
> first of all - many many thanks for the reply and all your hints.
> ATM - i am just in a hurry. But i will come back tomorrow and will do
> more to find what is wrong here.
>
> guess that it has to do with the file (folder) permissions. I think
> that i have issues to open the file i need to find - the xml-file that
> contains the passprhase in plain-text.
>
>
> i did some preliminary steps. see below
>
>
>
> Code:
> --------------------
> ./martin/.filezilla/filezilla.xml
> ./martin/Dokumente/os_systen_update/filezilla_
> linux-70ce:/home #
> linux-70ce:/home # minas-tirith:~ # LANG=C zypper lr --details
> If ‘minas-tirith:~’ is not a typo you can use command-not-found to lookup the package that contains it, like this:
> cnf minas-tirith:~
> linux-70ce:/home # LANG=C zypper lr --details

It was not my intention for you to run this exact command. I just gave
you an example of how to tell ANY command to print in English.

> linux-70ce:/home #
> linux-70ce:/home # grep Pass ~/.filezilla/filezilla.xml
> grep: /root/.filezilla/filezilla.xml: Datei oder Verzeichnis nicht gefunden
> linux-70ce:/home # ANG=en_US.UTF-8 zypper info kvm
> Metadaten von Repository ‘Packman’ werden abgerufen …[fertig]

And you are not doing it, again you are running commands using some non
English language which many of the volunteers here can not read. So
please repeat it in English. I told you how.

If you just want to locate files with a certain name, and then look
inside, you can just use the “find” functionality of “mc”.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

I don’t know much about this, other than it can be very useful. Inside the man page for ‘locale’ (selecting 1p) I note:


       LANG   Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internation-
              alization Variables for the precedence of internationalization variables used to determine the values of locale categories.)

Further to the above, for those of us who work in a multi-language environment, this can be very useful, not only for translating back to English (as an example for support in an English language subforum such as this) but also for non-native English language users to get a feed back in their native language if they are using an English language install.

The command “locale” will show information about “locale” on the server. The command “locale -a” will give you a list of all the “locale” one can use.

On 2014-12-01 08:06, oldcpu wrote:

> I don’t know much about this, other than it can be very useful. Inside
> the man page for ‘locale’ (selecting 1p) I note:
>
> Code:
> --------------------
>
> LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internation-
> alization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
>
> --------------------

Yep.

It is a very powerful thing that Windows doesn’t have an equivalent. You
can set a default language, different for each user in the same system.
Not only language.

> Further to the above, for those of us who work in a multi-language
> environment, this can be very useful, not only for translating back to
> English (as an example for support in an English language subforum such
> as this) but also for non-native English language users to get a feed
> back in their native language if they are using an English language
> install.

Absolutely.

Me, I prefer leaving “root” in English, because translations are often,
er, bad, if not missing (specially in documentations). I can say it that
bluntly because I’m a translator… we do what we can.

The administrator should work in English, but the users may choose. So
are things.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)