LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2004, 02:18 PM   #1
fiomba
Member
 
Registered: Sep 2004
Posts: 63

Rep: Reputation: 15
Search in configuration files


As I receive no answer from the experts to my thread "Compose new symbols with the keyboard" ( ... and I have made the enquiry on several forums !), I ask something simpler to solve the problem myself.

I need to find out a special symbol (for ex. "" - which I obtain with AltGr 2) in the configuration files generated by Mandrake 10. I have a USA keyboard without Win keys and the AltGr is for me merely the Alt key on the right.

My question is: using grep or whatever, how can I search for a given symbol or character in all the file system (beeing probably root), limiting the search, if possible, to configuration or text files?

I tried
Code:
 grep -r '' /*
but it doesn't work...
 
Old 10-30-2004, 02:50 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
That do searches for , but the key itself is called "twosuperior".
You can use xmodmap to define some key to send that or modify the files
in /etc/X11/xkb/ -directory.
 
Old 10-30-2004, 03:11 PM   #3
fiomba
Member
 
Registered: Sep 2004
Posts: 63

Original Poster
Rep: Reputation: 15
I don't want to use xmodmap! Please answer only at what I asked (if you know it...)
 
Old 10-30-2004, 08:06 PM   #4
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
I don't want to talk with people who can't read and/or write! Please go away.

<explanation for the ones thad don't see and understand symmetry in messaging>
I answered to what you asked and two to three other things I assumed that could help solving your problem in general. What I get back is just a message stating that "stop helping me" with the impression that the original poster didn't even dare to read what I said (or didn't read what he said and asked in the first place).
</explation>
 
Old 10-31-2004, 04:31 AM   #5
fiomba
Member
 
Registered: Sep 2004
Posts: 63

Original Poster
Rep: Reputation: 15
I have to apologize, but my experiences in forums has not been very good...

I asked :

"My question is: using grep or whatever, how can I search for a given symbol or character in all the file system (beeing probably root), limiting the search, if possible, to configuration or text files?"

The "" (or two superior) is only an example...

The problem is that to search all over the file system is a very lasting job...

I have in mind to isolate all the ASCII files by means of the shell function "file" in order to identify all the relevant files for my problem (how?).

But the real problem is that I have not received any significative answer to my thread "Compose new symbols with the keyboard".
I know that I could solve it with xmodmap, but on my enquiry I wanted to test a new method (to modify configuration files in order to get from the keyboard the desired symbols).

My last post was with this goal in mind:
to search where the mentioned key combinations are defined.

You said (01:06 AM) :"I don't want to talk with people who can't read and/or write! Please go away."

A part the fact that there was almost nothing to read... why after that you answered to other posts of mine?

I replicate here to those answers:

Doxigen (sw documentation) - 01:20 AM - A significative comment.

Loading USB printer failed - 01:22 AM - Are you taking me for a ride (...to be polite)? The printer works perfectly (under XP).

Bash script on manipulating files - 01:31 AM - For me it was an already closed post (beeing a newbie I don't know what to do, a part thanking the experts who gave me their opinion) - I appreciate nevertheless to know that the lenghts of lines can be obtained also by awk...
 
Old 10-31-2004, 06:33 AM   #6
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Feedback

I don't know did you wanted this, but I'm going to talk anyway, again.
This posting is not meaned to be offensive, but something you can learn about.

You said you don't have very good experiences about the forums. As I see it, there are few
things that could be done to get your experience about the forums better.[list=1][*] You automaticly assume there is some automatic connection between the threads. There isn't.[*] You write too much. [*] You say too little.[/list=1]

1.
Most of the people doesn't read all the threads.
Generally they just pick one or two from here and there.
If you really want to talk about other thread, how about talking in the other thread.
Also if you want to refer to other thread, please put a link to it, or atleast give a threadid;
most people don't bother to use search engine to figure out where you were referring to.

2.
It is hard to figure out from your posting what your problem exactly is.
Why so? Let me explain how parsing your message goes (in my eyes):
Quote:
As I receive no answer from...
some whining...

Quote:
I need to find out a special symbol (for ex. "" - which I obtain with AltGr 2) in the configuration files
Something that looks like describing a goal, but is not it. Just a step to do something.
Why this is not a goal?
Because people just don't want to find something for itself, they want to do something with the information.
Also looking for "" from conffiles doesn't make sense, because it is not written in that form.
Well, anyways, generally this leads to parse error and just skipping this chapter.
As a result, the rest of the problem is not thought as a practical one, but a technical one.

Quote:
My question is: ...
The chapter that got actually readed.

3.
So from this point of view, you are trying to do something like
"I want to search my system for -symbol" and you offer a grep
line with parameters that will do just what you want to do.

But instead of you being happy, you say that: "but it doesn't work".
What I reply back is that it do works (In my own words, that were
"That [will] do searches for "). All the talk about something working
or not working in the case of computer software is very often
semantically void. Something like discussion about values:
Someones good is someones bad, someones working is someones
not working.

Examples of good replacements for "but it doesn't work" could be something like
  • When I try to write it, my house starts buring and I have to leave, every time.
    This is the third house I'm living now; I'm not willing to test this command anymore.
    It doesn't work.
  • When I execute this command my computer starts keeping a funny noise and stops
    responding to anything so I have to reboot. So this command doesn't work.
  • When I execute this command numlock and scroll-lock leds start to blink and I get
    some error message saying "kernel panic", and "Aiee, killing interrupt handler".
    I tried googling for this, but most of them seem to be related to hardware problems
    and I found no hits related to running grep.
  • When I execute this command it just bounces me back to the console with a
    message "bash: grep: command not found".
  • When I run this command, it just bounces me back to the console with
    a message "grep: Invalid regular expression".
  • When I run this command, I get no results, just returns back to the prompt.
  • When I run this command, it gives me too much results.
  • Running this command seems to take forever. I had to cancel it after 30 minutes because
    I got bored.



I also checked your previous postings,
they have similar problems: too much noise, the beef is lost somewhere;
you don't make them easy to answer.


Enough about the lecturing...
Back to the original problem.
  • Searching for "" can be done by just using the command you already used. [as I already said]
    I honestly don't know how it just "doesn't work".
  • Probably there is no key referred as "" in the configuration files, but it is referred as a name
    "twosuperior", atleast in X configs. Something else in console. [as I already said]
  • Searching will also fail in console case, because the keymaps are probably compressed
    (in debian they are).
  • Are you trying to configure your X environment or virtual consoles? If later,
    have you checked the "keyboard console howto"?
  • Just want to know where the files are. X11 keyboard configurations can be found
    from /etc/X11/xkb [as I already said], especially the symbols -directory is interesting.
    Keymaps for console are located in /usr/share/keymaps.

Do you still think there was no information and/or wrong information in my first post to this thread?
 
Old 10-31-2004, 06:36 AM   #7
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Also you wanted to skip binary files from grep output? see "man grep".
 
Old 10-31-2004, 10:44 AM   #8
fiomba
Member
 
Registered: Sep 2004
Posts: 63

Original Poster
Rep: Reputation: 15
Thank you for the lesson...

One good thing comes out from a "contrast" with an expert: you try the best to demonstrate you are clever enough (in Linux)...

I solved my problem:

the grep all over the file system is
Code:
grep -rI char_sequence /
for newbies... -r --> recurse over the subdirs
-I --> (shift i) don't examine binary files
To be honest this solutions was suggested me in another forum...

The problem of "" ( or twosuperior) is well present to me. It can be possible to have or one or the other form (the first form is present in "compose.latin.inc", one of the two files loaded for keyboard initialization), but I agreee that also the other form can be present.

For that reason I prefer look at the configuration files (or in general to ASCII files).
To get such files I have found (by myself):
Code:
ls -aR | file -f ``-''|grep -v 'cannot' |grep -v '\./:'  > output_file
You must be root and start from "/"

Last edited by fiomba; 10-31-2004 at 10:47 AM.
 
Old 10-31-2004, 02:46 PM   #9
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Too sad you didn't learn a thing from that lesson..

I still don't:
  • see any problem in your first command, the one you said "it doesn't work".
  • know if you have problem in X11 or in console.
  • know what is wrong with xmodmap or
  • know if you found all the configuration files from /etc/X11/xkb and /usr/share/keymaps/.

Sometimes with some people even giving them choices a through c won't help: they still don't answer to requests for information no mater how simple the questions may be.

It seems that you got grep working, which is a good thing, but point is that I (nor anybody else) can't help you without you leting us to do so, thus you are on your own.
 
Old 10-31-2004, 04:45 PM   #10
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Well, I readed the messages again and found something:
"The problem is that to search all over the file system is a very lasting job..."
So, the "running this command seems to take forever" fits to this category.
and you answered to xmodmap question by saying that you want to try something else.
I just can't read.

Maybe I'm just being little too harsh today. Sorry for that.
After all, you said being a newbie what it comes to linux.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i search files for a particular string? darkpark Linux - Newbie 4 07-05-2005 05:46 PM
Search for files in Fedora 3 wjal Linux - Newbie 7 05-23-2005 09:51 PM
Search for Files vs. ls albean Linux - Newbie 2 11-14-2004 02:35 PM
Search all text files? nextekcarl Linux - General 4 10-20-2004 12:18 PM
can i search for files from the console? Chooco Linux - General 13 06-04-2002 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration