General :: Using Grep / Awk To Search For Colored Text

Sep 17, 2010

I have done a bunch of searches on this but the terms seem to get tangled in the more popular search of "colouring the output of grep / awk". I am trying to find a way to grep/awk through the output of a command to find text of a specific colour. The command's output has a range of colours signifying too many different things to specify using text, with colour being the only form of grouping.

View 5 Replies


ADVERTISEMENT

General :: Sed/awk/grep Search For Number String Of Variable Length In Text File?

Jan 19, 2010

I need to search a text file for a string of numbers which are different lengths, and always are between number=" and " like:

number="1234567890"
number="22390"

I need to grab those numbers and pipe each one to a line in a file. I've already tried something with awk and that didn't seem to work.

View 10 Replies View Related

General :: Search By Content On Ubuntu - Grep -rl "text Here" It Freezes?

Feb 19, 2011

I'd like to search the entire server by content. (text file) When I try grep -rl "text here", it freezes. How would you do it? And how long does it usually take?

View 4 Replies View Related

General :: Use Grep To Search For Multiple Options?

May 20, 2010

How can I use grep to search for line with either 'res' or 'rep'? i try "grep -e res|rep" or gre -e "rep|rep" but that does not work.

View 3 Replies View Related

General :: Search For A String In A Php File Using `grep`?

Jan 19, 2010

I am searching for Class declaration on a site with hundreds of PHP files, how can I do this in the current folder and subfolders using GREP?

I tested cding to the folder and then something like

grep -r 'class MyClass' *.php

View 5 Replies View Related

General :: Search A Grep For A Magic Word?

Feb 16, 2011

I am using ascript for general users to back up usb drives to lto4 tapes.. I wish to ahve some error checking to check IF is there is a tape in the tape drive to check for the tape:

if i do a
sudo mt -f /dev/st0 status
i will get back a
mt: /dev/st0: rmtioctl failed: Input/output error
if there is no tape in the drive or
sudo mt -f /dev/st0 status

[code].....

View 4 Replies View Related

General :: GREP - Search Special Characters

Feb 10, 2010

I need to search for the following pattern with GREP in a text file:

So I tried already:

But none of those works...I think probably because GREP doens't like the special character > in the middle of the serach pattern.

At the end I just need to now if GREP found the pattern in the file or not, so it should give me a 0 or a 1 back, once I check the value of the variable "?" after using the grep command.

View 4 Replies View Related

General :: Correct Usage Of Grep To Search A Disk?

Mar 26, 2009

I've been trying to identify all files on my cut-down version of Damn Small which contain the text string "User Agent:" in them. Because it's only 120Mb in its entirety, I'm quite happy to have grep search the whole system. I'm using this command, but it just generates errors as you can see:

[root@localhost ~]# grep -R 'User Agent:' /*
grep: /dev/dri/card0: Invalid argument
grep: /dev/fuse: Operation not permitted

[code]....

View 13 Replies View Related

General :: Search Date Period In Access Log Using Grep ?

Feb 19, 2010

I have a three input day,month and year. Currently i am using the following script to take the data.

Any grep advanced technique to avoid for loop?

View 2 Replies View Related

General :: Search Text In All Text Files Of All The Sub-directories?

Apr 21, 2010

Currently, when I'm searching text in files of my PHP project, I use this line :

Code:

grep -r 'myTextToFind' *

But now, I would like to search only in ".lang" files. How can I do that ?

View 7 Replies View Related

General :: How To Make Grep To Search A Pattern In Only Specific File Type?

Mar 6, 2010

To search a string pattern in all files in a directory and subdirectories, I am using;

Code:
grep -R "myclass::my-func(" mydirectory/
Now I want grep, to search in only specific file types say *.cc. Please help me. I have read manual of grep, but could not deduce any hint.
Best Regards.

View 7 Replies View Related

Ubuntu :: Getting Very Light Colored Text

Jan 5, 2010

I have an annoying text color problem. I don't know what to change to fix it. I have played around with System->Preferences->Appearance to no avail. Here is the problem: I am getting very light colored text so only the currently selected item is readable. The funny thing is that in Nautilus, Firefox, Chrome, Amarok, etc.. it's fine. It seems to be in only some programs in boxes with selectable line items, but also in the area that displays status updates in FileZilla. So I'm not sure how to pinpoint the problem.

View 9 Replies View Related

Red Hat / Fedora :: Get Multi Colored Text In The Terminal?

Aug 11, 2010

how do you get color in the terminal like DSL in red-hat 9.

i have red-hat 9 running on a old 3dfx gaming pc I'd post a pic of the DSL terminal but the site would not let me

View 2 Replies View Related

Software :: Text Is Colored Pixels During Boot?

Sep 11, 2010

I recently upgraded to Ubuntu 10.4 and, although that installation seemed to work OK for awhile, I have recently encountered a strange problem. I have a dual-boot system with Win XP and two releases of Ubuntu, 10.4 and 9.10. I installed the latter recently only to be able to run some legacy software. I believe the problem occurred sometime around or after the installation of the 9.10 package. Note that the 10.4 install was a clean install on a newly formatted HD, and not a normal upgrade from 9.10, which I installed later separately. The Ubuntu installations are on their own HD. Win XP is installed on its own separate HD.

Here's the problem. I can boot OK up to and including the appearance of the Grub 2 menu, which displays fine. From the menu I can chose Ubuntu 9.10, Win XP or several kernels of 10.4. The 9.10 Ubuntu boots completely normally, as does Win XP--no problems or irregularities with either of those. When I select one of the 10.4 Ubuntu kernels, the strangeness begins, as follows:

1.) The menu disappears, there is a brief period of blank screen, and then a bizarre screen appears. It has a violet/magenta background. The word "Ubuntu" appears in large type, with a couple of lines of text below it. However, all of the type is unreadable. Instead of being normal characters, all the text characters are displayed as blocks of seemingly random multi-colored pixels! I can recognize that it is supposed to be text, but the letters are just a bunch of colored pixels. I can recognize the large Ubuntu word because of its shape. Also, the whole text display occurs twice on the screen, one on the left and one on the right. Both are displayed as colored pixels.

2.) The screen stays there, as if frozen, and does not continue with installation of the kernel. After some experimenting, I discovered that if I press Ctrl-Alt-Del (!), the installation continues as one would expect: I soon get the normal login screen, am able to login OK, and my desktop soon appears as usual.

3.) However, once in the desktop, if I try to invoke a console window by pressing Ctrl-Alt-F1-6, the console window appears, but the text on the screen is again rendered as little bunches of colored pixels, completely unreadable. I can, in fact, login at these screens, but the text remains colored pixels. I can escape back to a normal desktop by then pressing Ctrl-Alt-F7, and the desktop comes back completely normal. Interestingly, if I invoke a terminal from the main Applications/Accessories/Terminal menu, I get a normal terminal in a desktop window that is perfectly usable.

4.) If, from the boot menu, I choose the Ubuntu 9.10 choice, everything works fine and as expected, including the Ctrl-Alt-F1-6 console windows. This problem only occurs with the Ubuntu 10.4 menu options.

Since this problem only occurs with the Ubuntu 10.4 menu choices, my guess is that there is something askew in the display configuration of those specific choices. But, I've not discovered what to check for that configuration or how to correct it. I've checked out the /boot/grub/grub.cfg file, the /etc/grub.d number files, and /etc/default/grub, but can't find anything that seems to be the cause or the remedy.

View 4 Replies View Related

General :: Using Sed And Grep With A Text String?

Apr 28, 2011

Q: Is there any way to use grep and sed with a string variable rather than with a file?

The problem: Im running through a LARGE (about 10,000 lines) xhtml file and need to replace every instance of lines beginning <p>~

The following code works but takes a long time mainlly because an in/out operation needs to be carried out on each line. If I could read from a string rather than a file it would take a much shorter time!

Code:
#!/bin/bash
count=$((0))
>tpf
echo "waiting....."

[Code].....

View 4 Replies View Related

General :: Grep Multiple Lines From A Text File

Jun 17, 2009

I have a list of words that I want to grep in many files to see which ones have it and which ones dont. in the text file I have all the words listed line by line, ex: list.txt:

check
try this
word1
word2
open space
list ..

I want to grep each line one by one. like I want it to

grep "check" *.log
grep "try this" *.log
grep "word1" *.log .. etc how can I do this?

and maybe write the output to a file.

View 5 Replies View Related

General :: Grep - Manipulating Large Text File Full Of Records

Nov 26, 2010

I'm trying to manipulate a large text file full of records (metadata - one complete record per line). I need to delete every line on which certain words appear - there are five different words, all pretty simple all-caps strings with occasional whitespace. I tried using grep -v, which worked a treat, but only string-by-string. Ideally I'd like to run this as grep -v -f, where the file targeted by the -f contains the strings I need to match in order to delete the lines they're in.

i.e. grep -v -f filecontainingSTRINGS.txt targetfile.txt > outputfile.txt

When I try this, however, I don't get any matches - or more specifically, no changes are made in the output file. It works fine if there's only one string in filecontainingSTRINGS, but it doesn't work if there's more than one (I'm using newline as the delimiter). (Also my machine doesn't recognise /usr/xpg4/bin/grep - no idea what that's all about!)

View 5 Replies View Related

General :: Search For Text Strings

May 19, 2011

What would be the best way to search for a file that contains a string similar to this:

View 1 Replies View Related

General :: Stop Search Param In Directories By Grep Immediately After Param Match

Jun 17, 2010

I use the following command to find under /var some param in my script

grep -R "param" /var/* 2>/dev/null |grep -wq "param"

my problem is that: after grep find the param in file grep continue to search until all searches under /var/* will completed

How to perform stop immediately after grep match the param word

For example when I run the: grep -R "param" /var/* 2>/dev/null |grep -wq "param"

grep find the param after one second.

But grep continue to Search other same param on other files and its take almost 30 seconds

How to stop the grep immediately after param match?

View 1 Replies View Related

Programming :: Grep Search Between N-m

Oct 5, 2010

How can i use grep (or any other command) to check for lines that begin with N number.

E.g. I want to print out commands (from history), but only from the command number 50 until #200.

This one doesn't work:

Code:
history | grep "^[50-200]"
Should print out something like:
Code:
50 cd ~/Desktop

[Code].....

View 4 Replies View Related

General :: Bash - Search For A Text Pattern?

Nov 28, 2010

I need to search for a string "teststring" in all *.java files coming under /home/user1/ (including subfolders). How can I do it in linux via shell command.

View 5 Replies View Related

General :: Reverse Search Within Text From Given Anchor

Jul 12, 2011

I have a html page and I would like to search for the occurance of a given string as an anchor. Then I would like to search backward for a the first match to a given regular expression. As a result I would like to output the text between the two points.

Please note that I would like to have the output up to the first regex match before the ANCHOR point.What is the best tool to solve this?

View 1 Replies View Related

Ubuntu :: Grep Can't Search Pdf File?

Jun 2, 2010

i want to search some key words in some pdf files grep myword ~/test.pdf that command can't work! grep command can't search pdf file??

View 1 Replies View Related

General :: Search For Text Strings In Multiple PHP Files?

Feb 3, 2011

Long story short, I got a folder with nearly 800,000 php files. I would like to search each file for a string and if it exists in that file, the file gets copied to another directory. Is this possible from the terminal? So far I got: grep -i -n -r 'ppr-1792' * | cp $1 move_to_here

But this obviously doesn't work. $1 needs to be the file name that contains matching text.

View 2 Replies View Related

General :: Search In Files Text That Is One-byte Encoding?

Sep 3, 2010

how to search in files text that is one-byte encoding? places - search for files in gnome in ubuntu searches only utf-8 text.i know one way: install wine and total commander, then search with it. what are better ways?[URL]

View 4 Replies View Related

General :: Find Text After String Search In File

Aug 2, 2011

I have a file called Regions.ini that looks like this:

Code:
[Granite]
RegionUUID = 54ab7cd2-0e70-49b7-8020-8dbeb84c08d0
Location = 9991,10007
InternalAddress = 0.0.0.0
InternalPort = 9001
AllowAlternatePorts = False
ExternalHostName = 71.171.21.9

[Syenite]
RegionUUID = 8fc56fdd-0afd-4074-9432-0ae8f42b799f
Location = 9992,10007
InternalAddress = 0.0.0.0
InternalPort = 9000
AllowAlternatePorts = False
ExternalHostName = 71.171.21.9
What I need to do is find out what the IP address is after "ExternalHostName ="

After that I will need to compare that IP to whatismyip and if it's different then replace it but that is easy to do with sed. I just can't figure this simple hurdle out.

View 12 Replies View Related

General :: Search For Exact Repetitions In Text File

Nov 23, 2010

I've got a big text file in which I know have probably made some typos (LaTeX). Sometimes I rewrite sentences several times and then end up with double pieces like "the the" or "is is" without noticing it. Most spell checkers that I can use in LaTeX are very basic so they do not notice these grammar errors. Is there a way that I can search for these repetitions by hand using sed or awk or something along these lines? Is there an app for that?

View 3 Replies View Related

Ubuntu :: GREP - Return Only Search String?

Jan 13, 2011

I have a mail.log file, of which I want to redirect only the search strings of the sender from=<example.sender@exampledomain.com> and the size size=4537 to a file.

In every case the sender string starts as from=<> and the size string starts as size=

What would be the grep command to redirect only the two search strings to a .txt file?

View 2 Replies View Related

General :: Recursive Search For Files That Hold Some Specific Text?

Jan 18, 2011

How do I recursively generate a text file which has a list of all files on my server which contain a specific string anywhere in the files?

I know the following command can be used to replace a string recursively

find /var/www -type f -print0 | xargs -0 sed -i 's/old string/new string/g'

I do not want to replace the string, I just want a list of all files which contain the string.

View 4 Replies View Related

General :: Ubuntu - Search Text In Files And Display File Name?

Mar 30, 2011

I am using find some_dir -name "*.some_ext" | xargs -l10 grep "some_expr"

to find files in folder, but I just want to display the file name but not all file content. Any solution?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved