Search Results

Search found 2253 results on 91 pages for 'grep'.

Page 8/91 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Alternatives for 'egrep -o "success|error|fail" <filename> | sort | uniq -c'

    - by Wolfy
    I sometime need to check some logs and I do this with this command: egrep -o "success|error|fail" <filename> | sort | uniq -c Sample input: test error on line 10 test connect success test insert success test started at 00:00 test delete fail Sample output: 1 error 1 fail 2 success I would like to know if someone knows a way to do this with a shorter command? Before you ask why I would like to do this with an different command... No special reason, I'm just curious :)

    Read the article

  • Space (and pipe sign) works on occasion only

    - by Timo Riikonen
    I have an issue that when I try to write pipe sign "|" and space after that, I sometimes get wrong type of space (\240) and my command fails. This issue persists on different shells. How could I fix this? I am using Finnish keyboard layout. timo@timo-i7-ubuntu:~$ ps -ef | grep ruby timo 7169 2633 0 12:12 pts/2 00:00:00 ruby1.9.1 /usr/local/bin/rails new admin4 timo 8736 26515 0 14:22 pts/4 00:00:00 grep --color=auto ruby timo@timo-i7-ubuntu:~$ ps -ef | grep ruby No command ' grep' found, did you mean: Command 'igrep' from package 'openimageio-tools' (universe) Command 'dgrep' from package 'debian-goodies' (main) Command 'rgrep' from package 'grep' (main) Command 'zgrep' from package 'gzip' (main) Command 'zgrep' from package 'zutils' (universe) Command 'sgrep' from package 'sgrep' (universe) Command 'lgrep' from package 'lv' (universe) Command 'egrep' from package 'grep' (main) Command 'ngrep' from package 'ngrep' (universe) Command 'grep' from package 'grep' (main) Command 'agrep' from package 'agrep' (multiverse) Command 'pgrep' from package 'procps' (main) Command 'xgrep' from package 'xgrep' (universe) Command 'vgrep' from package 'atfs' (universe) Command 'fgrep' from package 'grep' (main)  grep: command not found timo@timo-i7-ubuntu:~$ cat pipecom ps -ef | grep rails timo@timo-i7-ubuntu:~$ cat pipecom2 ps -ef | grep rails timo@timo-i7-ubuntu:~$ ./pipecom timo 7169 2633 0 12:12 pts/2 00:00:00 ruby1.9.1 /usr/local/bin/rails new admin4 timo 8777 8775 0 14:26 pts/4 00:00:00 grep rails timo@timo-i7-ubuntu:~$ ./pipecom2 ./pipecom2: line 1: $'\302\240grep': command not found timo@timo-i7-ubuntu:~$ diff -w pipecom pipecom2 1c1 < ps -ef | grep rails --- > ps -ef | grep rails

    Read the article

  • "Google files": Building a web interface to find/ack/grep

    - by user27915816
    I am working on a project where we would like to have build a web interface that gives the user the ability to "Google" files in a directory in a remote machine. For example, the user would type a string in a box, and then the system would find all files that contain that string and present them in the browser. The system would then give the user the ability click on any of the files to open them/display them in the browser. We want to avoid reinventing the wheel if possible, but don't really know where to start (none of us in the team have much experience building websites). What software packages, libraries or tools exist that can help us get this done?

    Read the article

  • Grepping through the results of apachectl -S

    - by CamelBlues
    I have a server with about 300 virtual hosts. When I want to make sure a specific httpd.conf file is loaded into the Virual Host config and the syntax is correct, I run apachectl -S. The problem is, though, I get a ton of output. I've tried apacectl -S | grep 'foo' and apachectl -S > foo.txt to try and make this data a little bit more manageable, but the output of the command is not conducive to grepping or shoving into a text file. When I try apachectl -S | grep 'foo', it simply returns the entire output of apachectl -S. When I try apachectl -S > foo.txt, foo.txt is an empty file. This may have something to do with how the server is configured, because I am able to successfully grep on my local machine. Any suggestions?

    Read the article

  • trying to prune down a list of files

    - by romunov
    I have a list of files and I'm trying to extract all layer1_*.grd files. Is there a way of doing this in one grep expression? lof <- c("layer1_1.grd", "layer1_1.gri", "layer1_2.grd", "layer1_2.gri", "layer1_3.grd", "layer1_3.gri", "layer1_4.grd", "layer1_4.gri", "layer1_5.grd", "layer1_5.gri", "layer2_1.grd", "layer2_1.gri", "layer2_2.grd", "layer2_2.gri", "layer2_3.grd", "layer2_3.gri", "layer2_4.grd", "layer2_4.gri", "layer2_5.grd", "layer2_5.gri", "layer3_1.grd", "layer3_1.gri", "layer3_2.grd", "layer3_2.gri", "layer3_3.grd", "layer3_3.gri", "layer3_4.grd", "layer3_4.gri", "layer3_5.grd", "layer3_5.gri", "layer4_1.grd", "layer4_1.gri", "layer4_2.grd", "layer4_2.gri", "layer4_3.grd", "layer4_3.gri", "layer4_4.grd", "layer4_4.gri", "layer4_5.grd", "layer4_5.gri" I tried doing this in two steps: list.of.files <- list.files(pattern = c("1_")) list.of.files <- list.of.files[grep(".grd", list.of.files)] Can someone enlighten me how to do this with grep in one step? I naively tried passing list() and c() to the grep but, as you can imagine, it doesn't work. list.of.files <- list.files() list.of.files <- list.of.files[grep(list("1_", ".grd"), list.of.files)]

    Read the article

  • Combine multiple unix commands into one output

    - by Ben McCormack
    I need to search our mail logs for a specific e-mail address. We keep a current file named maillog as well as a week's worth of .bz2 files in the same folder. Currently, I'm running the following commands to search for the file: grep [email protected] maillog bzgrep [email protected] *.bz2 Is there a way combine the grep and bzgrep commands into a single output? That way, I could pipe the combined results to a single e-mail or a single file.

    Read the article

  • Spamassassin command to tag & move mail with an X-Spam-Score of 10+ to a new dir?

    - by ane
    Have a maildir with tens of thousands of messages in it, about 70% of which are spam. Would like to: Run /usr/local/bin/spamassassin against it, tagging each message if the score is 10 or greater Have a tcsh shell or perl one-liner grep all mails with a spam score of over 10 and move those mails to /tmp/spam What commands can I run to accomplish this? Pseudocode: /usr/local/bin/spamassassin ./Maildir/cur/* -tagscore10 grep "X-Spam-Score: [10-100]" ./Maildir/cur/* | mv %1 /tmp/spam

    Read the article

  • How to view hidden files using Linux `find` command

    - by Tom
    On a Linux server, I need to find all files with a certain file extension in the current directory and all sub-directories. Previously, I have always using the following command: find . -type f | grep -i *.php However, it doesn't find hidden files, for example .myhiddenphpfile.php. The following finds the hidden php files, but not the non-hidden ones: find . -type f | grep -i \.*.php How can I find both the hidden and non-hidden php files in the same command?

    Read the article

  • Prefix time to each line of bash command output

    - by neildeadman
    I am running the top command to see details about specific processes. The output is piped to grep like so: top -n 1 | grep jre The output is usually around 4 lines, and I would like to prefix the current time to each line so it would be something like: Before: 2772 deleteme 20 0 2832 1156 872 R 2.0 0.1 0:00.01 top After: 13:46 25-08-2012 2772 deleteme 20 0 2832 1156 872 R 2.0 0.1 0:00.01 top

    Read the article

  • greping files question

    - by tearman
    I've been using grep to run a few PII scans and while its finding results, its indeed finding too many false positives. Is there a way that I can tell grep not to trigger a match for a file unless it contains other data? For instance, can I tell it not to trigger an alert on a regex for a SSN unless the file includes text like "ssn" or "social security number"?

    Read the article

  • Continuously check nestat output for a particular program

    - by Vihaan Verma
    I have a android emulator running on port 5554. I want to continuously watch the netstat output concerning emulator stuff. right now I have to manually execute this command every time sudo netstat -plant | grep emulator I thought doing something like this would repeat above command automatically every 2 sec. watch sudo netstat -plant | grep emulator but instead it hangs the terminal. How to achieve such functionality ? Thanks

    Read the article

  • Spamassassin command to tag & move mail with an X-Spam-Score of 10+ to a new directory?

    - by ane
    Have a maildir with tens of thousands of messages in it, about 70% of which are spam. Would like to: Run /usr/local/bin/spamassassin against it, tagging each message if the score is 10 or greater Have a tcsh shell or perl one-liner grep all mails with a spam score of over 10 and move those mails to /tmp/spam What commands can I run to accomplish this? Pseudocode: /usr/local/bin/spamassassin ./Maildir/cur/* -tagscore10 grep "X-Spam-Score: [10-100]" ./Maildir/cur/* | mv %1 /tmp/spam

    Read the article

  • Spamassassin one-liner to tag & move mail with an X-Spam-Flag: YES to a new directory?

    - by ane
    Say you have a directory with tens of thousands of messages in it. And you want to separate the spam from the non-spam. Specifically, you would like to: Run spamassassin against the directory, tagging each message with an X-Spam-Flag: YES if it thinks it's spam Have a tcsh shell or perl one-liner grep all mail with the flag and move those mails to /tmp/spam What command can you run to accomplish this? For example, some pseudocode: /usr/local/bin/spamassassin -eL ./Maildir/cur/* | grep "X-Spam-Flag: YES" | mv %1 /tmp/spam

    Read the article

  • Spamassassin command to tag mail & move mail with a spam score of over 10 to a new folder?

    - by ane
    Have a maildir with tens of thousands of messages in it, about 70% of which are spam. Would like to: Run /usr/local/bin/spamassassin against it, tagging each message if the score is 10 or greater Have a tcsh shell or perl one-liner grep all mails with a spam score of over 10 and move those mails to /tmp/spam What commands can I run to accomplish this? Pseudocode: /usr/local/bin/spamassassin ./Maildir/cur/* -tagscore10 grep "X-Spam-Score: [10-100]" ./Maildir/cur/* | mv %1 /tmp/spam

    Read the article

  • Grep... What patterns to extract href attributes, etc. with PHP's preg_grep?

    - by inktri
    Hi, I'm having trouble with grep.. Which four patterns should I use with PHP's preg_grep to extract all instances the "____" stuff in the strings below? 1. <h2><a ....>_____</a></h2> 2. <cite><a href="_____" .... >...</a></cite> 3. <cite><a .... >________</a></cite> 4. <span>_________</span> The dots denote some arbitrary characters while the underscores denote what I want. An example string is: </style></head> <body><div id="adBlock"><h2><a href="https://www.google.com/adsense/support/bin/request.py?contact=afs_violation&amp;hl=en" target="_blank">Ads by Google</a></h2> <div class="ad"><div><a href="http://www.google.com/aclk?sa=L&amp;ai=C4vfT4Sa3S97SLYO8NN6F-ckB5oq5sAGg6PKlDaT-kwUQASCF4p8UKARQtobS9AVgyZbRhsijoBnIAQGqBBxP0OSEnIsuRIv3ZERDm8GiSKZSnjrVf1kVq-_Y&amp;num=1&amp;sig=AGiWqtwG1qHnwpZ_5BNrjrzzXO5Or6EDMg&amp;q=http://www.crackle.com/c/Spider-Man_The_New_Animated_Series/%3Futm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3DGST_10016_CRKL_US_PRD_S_TeleV_SPID_Tele_Spider-Man%26utm_term%3Dspiderman%26utm_content%3Ds264Yjg9f_3472685742_487lrz1638" class="titleLink" target="_parent">Spider-<b>Man</b> Animated Serie</a></div> <span>See Your Favorite Spiderman <br> Episodes for Free. Only on Crackle.</span> <cite><a href="http://www.google.com/aclk?sa=L&amp;ai=C4vfT4Sa3S97SLYO8NN6F-ckB5oq5sAGg6PKlDaT-kwUQASCF4p8UKARQtobS9AVgyZbRhsijoBnIAQGqBBxP0OSEnIsuRIv3ZERDm8GiSKZSnjrVf1kVq-_Y&amp;num=1&amp;sig=AGiWqtwG1qHnwpZ_5BNrjrzzXO5Or6EDMg&amp;q=http://www.crackle.com/c/Spider-Man_The_New_Animated_Series/%3Futm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3DGST_10016_CRKL_US_PRD_S_TeleV_SPID_Tele_Spider-Man%26utm_term%3Dspiderman%26utm_content%3Ds264Yjg9f_3472685742_487lrz1638" class="domainLink" target="_parent">www.Crackle.com/Spiderman</a></cite></div> <div class="ad"><div><a href="http://www.google.com/aclk?sa=l&amp;ai=CnQFi4Sa3S97SLYO8NN6F-ckB3M7nQtyU2PQEq6bCBRACIIXinxQoBFCm15KB-f____8BYMmW0YbIo6AZoAHiq_X-A8gBAaoEIU_Q9JKLiy1MiwdnHpZoBnmpR1J8pP2jpTwMx2uj2nN4WA&amp;num=2&amp;sig=AGiWqtwDrI5pWBCncdDc80FKt32AJMAQ6A&amp;q=http://www.costumeexpress.com/browse/TV-Movies/_/N-1z141uu/Ntt-batman/results1.aspx%3FREF%3DKNC-CEgoogle" class="titleLink" target="_parent">Kids <b>Batman</b> Costumes</a></div> <span>Great Selection of <b>Batman</b> &amp; Batgirl <br> Costumes For Kids. Ships Same Day!</span> <cite><a href="http://www.google.com/aclk?sa=l&amp;ai=CnQFi4Sa3S97SLYO8NN6F-ckB3M7nQtyU2PQEq6bCBRACIIXinxQoBFCm15KB-f____8BYMmW0YbIo6AZoAHiq_X-A8gBAaoEIU_Q9JKLiy1MiwdnHpZoBnmpR1J8pP2jpTwMx2uj2nN4WA&amp;num=2&amp;sig=AGiWqtwDrI5pWBCncdDc80FKt32AJMAQ6A&amp;q=http://www.costumeexpress.com/browse/TV-Movies/_/N-1z141uu/Ntt-batman/results1.aspx%3FREF%3DKNC-CEgoogle" class="domainLink" target="_parent">www.CostumeExpress.com</a></cite></div> <div class="ad"><div><a href="http://www.google.com/aclk?sa=l&amp;ai=CAMYT4Sa3S97SLYO8NN6F-ckB3ZnWmgGdoNLrDaumwgUQAyCF4p8UKARQrqSVxwdgyZbRhsijoBmgAZH77uwDyAEBqgQYT9DU7oqLLEyLB2dHlxZFnQzyeg-yHt88&amp;num=3&amp;sig=AGiWqtzqAphZ9DLDiEFBJlb0Ou_1HyEyyA&amp;q=http://www.OfficialBatmanCostumes.com" class="titleLink" target="_parent"><b>Batman</b> Costume</a></div> <span>Official <b>Batman</b> Costumes. <br> Huge Selection &amp; Same Day Shipping!</span> <cite><a href="http://www.google.com/aclk?sa=l&amp;ai=CAMYT4Sa3S97SLYO8NN6F-ckB3ZnWmgGdoNLrDaumwgUQAyCF4p8UKARQrqSVxwdgyZbRhsijoBmgAZH77uwDyAEBqgQYT9DU7oqLLEyLB2dHlxZFnQzyeg-yHt88&amp;num=3&amp;sig=AGiWqtzqAphZ9DLDiEFBJlb0Ou_1HyEyyA&amp;q=http://www.OfficialBatmanCostumes.com" class="domainLink" target="_parent">www.OfficialBatmanCostumes.com</a></cite></div> <div class="ad"><div><a href="http://www.google.com/aclk?sa=l&amp;ai=C767t4Sa3S97SLYO8NN6F-ckBkZfSfoOppaMHq6bCBRAEIIXinxQoBFDX2bw6YMmW0YbIo6AZoAHpprP8A8gBAaoEG0_QhJSMiytMiwdnHpZoF3g0Uj8_Vl2r4TpI_g&amp;num=4&amp;sig=AGiWqtyGO2DnFq_jMhP6ufj8pufT9sWQWA&amp;q=http://www.discountsuperherocostumes.com/batman-costumes.html" class="titleLink" target="_parent">Discount <b>Batman</b> Costumes</a></div> <span>Discount adult and kids <b>batman</b> <br> superhero costumes.</span> <cite><a href="http://www.google.com/aclk?sa=l&amp;ai=C767t4Sa3S97SLYO8NN6F-ckBkZfSfoOppaMHq6bCBRAEIIXinxQoBFDX2bw6YMmW0YbIo6AZoAHpprP8A8gBAaoEG0_QhJSMiytMiwdnHpZoF3g0Uj8_Vl2r4TpI_g&amp;num=4&amp;sig=AGiWqtyGO2DnFq_jMhP6ufj8pufT9sWQWA&amp;q=http://www.discountsuperherocostumes.com/batman-costumes.html" class="domainLink" target="_parent">www.discountsuperherocostumes.com</a></cite></div></div></body> <script type="text/javascript"> var relay = ""; </script> <script type="text/javascript" src="/uds/?file=ads&amp;v=1&amp;packages=searchiframe&amp;nodependencyload=true"></script></html> Thanks!

    Read the article

  • ash scripting: space-containing variable refuses to be grepped

    - by Luci Sandor
    I am trying to run the script listed at http://talk.maemo.org/showthread.php?t=70866&page=2 on its intended hardware, a Nokia Linux phone running BusyBox ash. The script receives the name of WiFi network as a parameter, and tries to connect the phone to it. I suspect the script works, but my SSID, BU (802.1x), has space and parentheses in it. So when I type at the command prompt autoconnect.sh BU\ \(802.1x\) I get various errors. First, LIST=`iwconfig wlan0 | awk -F":" '/ESSID/{print $2}'` if [ $LIST = "\"$1\"" ]; then ...fails, even I am connected to the network. The error is not avoided by using single or double quotes instead of escaping characters at the command prompt. Second, if [ -z `iwlist wlan0 scan | grep -m 1 -o \"$1\"` ]; then echo SSID \"$1\" not found; shows that grep does not find the string, although the same grep, typed directly into the command prompt, does find 'BU (802.1x)'. How do I quote $1 in the two circumstances above so that it will work with my network SSID, containing spaces and parentheses? Thank you.

    Read the article

  • grep command is not search the complete pattern

    - by Sumit Vedi
    0 down vote favorite I am facing a problem while using the grep command in shell script. Actually I have one file (PCF_STARHUB_20130625_1) which contain below records. SH_5.55916.00.00.100029_20130601_0001_NUC.csv.gz|438|3556691115 SH_5.55916.00.00.100029_20130601_0001_Summary.csv.gz|275|3919504621 SH_5.55916.00.00.100029_20130601_0001_UI.csv.gz|226|593316831 SH_5.55916.00.00.100029_20130601_0001_US.csv.gz|349|1700116234 SH_5.55916.00.00.100038_20130601_0001_NUC.csv.gz|368|3553014997 SH_5.55916.00.00.100038_20130601_0001_Summary.csv.gz|276|2625719449 SH_5.55916.00.00.100038_20130601_0001_UI.csv.gz|226|3825232121 SH_5.55916.00.00.100038_20130601_0001_US.csv.gz|199|2099616349 SH_5.75470.00.00.100015_20130601_0001_NUC.csv.gz|425|1627227450 And I have a pattern which is stored in one variable (INPUT_FILE_T), and want to search the pattern from the file (PCF_STARHUB_20130625_1). For that I have used below command INPUT_FILE_T="SH?*???????????????US.*" grep ${INPUT_FILE_T} PCF_STARHUB_20130625_1 The output of above command is coming as below PCF_STARHUB_20130625_1:SH_5.55916.00.00.100029_20130601_0001_US.csv.gz|349|1700116234 I have two problem in the output, first is, only one entry is showing in output (It should contain two entries) and second problem is, output contains "PCF_STARHUB_20130625_1:" which should not be came. output should come like below SH_5.55916.00.00.100029_20130601_0001_US.csv.gz|349|1700116234 SH_5.55916.00.00.100038_20130601_0001_US.csv.gz|199|2099616349 Is there any technique except grep please let me know. Please help me on this issue.

    Read the article

  • Search for and print only matched pattern

    - by Ayman
    I have some huge xml text files. I need to write a script to find and print a specific tag only. I tried sed and grep but they both return the whole line. Using SunOS 5.x, so not all linux commands may work. grep -o is not available. The 'xml' file is not actually one huge xml document, but each line is a separate xml document, with just a few tags, not even nested. And the structure is fairly easy, so full xml parsers is not needed, and probably would not work. I was looking for sed, awk, or some other one liners, but could not get them to work, and they are both relatively new to me.

    Read the article

  • Regular expression in BASH

    - by Ryan
    Hello everyone, I was hoping someone could answer my quick question as I am going nuts! I have recently started learning regular expressions in my Java programming however am a little confused how to get certain features to work correctly directly in BASH. For example, the following code is not working as I think it should. echo 2222 | grep '2\{2\}' I am expecting it to return: 22 I have tried variations of it including: echo 2222 | grep '2{2}' echo 2222 | grep -P '2\{2\}' echo 2222 | grep -E '2\{2\}' However I am completely out of ideas. I'm sure this is a simple parameter / syntax fix and would love some help! P.S I've done tons of googling and every reference I find does not work in BASH; regex's can run on so many different platforms and engines =/

    Read the article

  • unix command to verify span of word in text

    - by Ocasta Eshu
    What unix command(s) can I use to determine the line span that a word appears in text? The "span" being equal to the line number of the last instance of a word minus the line number of the first instance of the word. 1| unix is on two lines 2| once above, and once below 3| unix In the example above the "span" of 'unix' would be 2 (3-1). So far I've been trying to make use of grep -n but I don't think that grep is powerful enough. Maybe some use of sed or awk? Thanks!

    Read the article

  • bash : "set -e" and check if a user exists make script exit

    - by Dahmad Boutfounast
    i am writing a script to install a program with bash, i want to exit on error so i added "set -e" in the beginning of my script. the problem is that i have to check if a user exists inside of my script, to do this i am using "grep "^${USER}:" /etc/passwd", if the user exists, the script runs normally, but if the user doesn't exist, this command exists, and i don't want to exit on this case (i have to create the user and continue my installation). so what's the solution to make my script continue running ?? i tried to redirect the output of "grep" to a variable, but i still have the same problem :( thanks.

    Read the article

  • Gathering IP's from a complicated log

    - by Harry
    I have a question regarding the use of some more advanced grep, awk, sed. I have a log file, for a proprietary MTA, that contains IP's in a string, delimited by [redacted]^~x.x.x.x^[redacted]. So far all of my grepping, awking, and sedding hasn't gotten me very far. This log file has 331520 lines in it. My goal was to simply grep out the ip's, then do a for loop with sed, to sed 's/$i/redacted'. I'm including a sample of one of the log entries. If you all have any idea, I would be greatly appreciative. Jun 4 15:21:52 host.name mta-name: 13388^~88/CC-04671-FCA0DCF4^~D^~<redactedmessageid>^~@^[email protected]^~redacted.hostname^~000.00.000.000^~port^~esmtp^~^~external_routing_nobounce^~0^~0.51^~subjectofmessage^~250 2.6.0 <redactedmessageid> [InternalId=2178458] Queued mail for delivery

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >