I have a listing of files that have numeric characters at the end after a dot.  ex :   abc.log abc.log.1 xyz.log xyz.log.1 xyz.log.2   I need to list only the logs that have .log at the ending and not the ones with .log.1 or .log.2 at the ending.
124265
If I do:  $ ls -R .: 4Shared/  Cloud/  ./4Shared: UFAIZLV2R7.part3.rar  ./Cloud: UFAIZLV2R7.part2.rar.part UFAIZLV2R7.part1.rar.part UFAIZLV2R7.part4.rar.part   If I want to list the .rar files only, and I use grep, it will show me too the .rar.part files, what is not my wish. I am solving this using find or ls **/*.rar as told in  and they work fine, but I would like to learn if it is possible to do it via grep.    I have tried (thinking about EOL):  ls -R | grep ".rar\n"   with no results. I think that the problem lies in discover if the greping is found at the end of the line, but I am not sure.    Any help out here, please?
75528
More often that I like to admit I look for a file that contains some strings.  Currently I do:  grep -rl string1 | xargs grep -l string2 | xargs grep -l string3   Is there a tool that does this prettier?  This greps for string1 or string2 or string3.   grep -rl -e string1 -e string2 -e string3   I want files that contain string1 and string2 and string3 but not necessarily on the same line.  Maybe one of the modern greps (ag/ack/rg/sift) can do this?
35718
\includegraphics cannot handle filenames that contain more than the one dot, separating the filename from the extension. Apparently it uses everything after the first dot as extension and then, of course, complains about an unknown graphics extension.  This is annoying as I very often have filenames that contain parameter values, e.g. plot_a0.4_b0.6.pdf.  Is there a way to teach LaTeX to interpret only the string behind the last dot as extension?
92353
Assuming that the grep tool should be used, I'd like to search for the text string "800x600" throughout the entire file system.  I tried:  grep -r 800x600 /   but it doesn't work.  What I believe my command should do is grep recursively through all files/folders under root for the text "800x600" and list the search results.  What am I doing wrong?
44876
I have a situation where I have the following:  file01.ext . . . file99.ext file100.ext . . .   And I want to (using rename ) insert the '0' for the files 01-99 (so that they become 000-099) but not modify files larger than 100. Which expression should I use and what is a good source on learning regular expressions such as these?   On Windows I would have used Total Commander's multi rename function which has a very simple renaming syntax. Are there some good alternatives for that tool (multi-rename) for Ubuntu?
46112
Say I'm printing out a long series of strings, and instead of only showing lines containing a certain pattern (which one uses "grep" to do), how do I filter out certain patterns?
122356
I have a program that would output something like this:  ^[0;33m"2015-02-09 11:42:36 +0700 114.125.x.x access"^[0m   Is there built in linux program that could clean that output up into something like this  "2015-02-09 11:42:36 +0700 114.125.x.x access"
75502
I have a tabular file in which the first column has IDs and the second one has numeric values. I need to generate a file that contains only the line with the largest score for each ID.  So, I want to take this:  ES.001      2.33 ES.001      1.39 ES.001    119.55 ES.001     14.55 ES.073      0.35 ES.073     17.95 ES.140      1.14 ES.140     53.88 ES.140     18.28 ES.178    150.27   And generate this:  ES.001    119.55 ES.073     17.95 ES.140     53.88 ES.178    150.27   Is there a way of doing this from a bash command-line?
33944
pwd : ../bin under bin I have a directory called datafiles.  Use meta characters and the ls -lL command (with lower and upper case L) to list all filenames under the datafiles directory that contain a dot . with the letter 'f' or 'u' anywhere after the dot.  I tried: ls -lL datafiles *.*f*u  ls -lL datafiles .[f*u]     Thank you for answering. Unfortunately, none of the solutions worked the way I wanted it.  By clarifying the question, /bin/datafiles/file.backup is the root to the directory. From the /bin directory, the command I used is ls -lL datafiles followed by meta characters.  I'm looking for file.backup that has a dot and followed by f or u, not directly followed by f or u (anywhere after the dot), and not ending by f or u.
64455
All is (typographically) fine with this MWE  \documentclass{scrbook} \begin{document}   \tableofcontents   \chapter{chapter}   \chapter{chapter} \end{document}     But as soon as I add \part to it the numbers are getting enddots:  \documentclass{scrbook} \begin{document}   \tableofcontents   \part{part}   \chapter{chapter}   \chapter{chapter} \end{document}     To get rid of the enddots one needs numbers=noenddot:  \documentclass[ numbers=noenddot ]{scrbook} \begin{document}   \tableofcontents   \part{part}   \chapter{chapter}   \chapter{chapter} \end{document}   What is the reason for putting dots to the numbers as soon as one has \part in the document?
50300
I want to list all files in a directory that start with 'abc' and end with '.zip'  I'm trying to use ls.  The directory has a lot of zip files starting with abc&lt;date&gt; and xvz&lt;date&gt;. I only want to get the list of the abc&lt;date&gt;.zip
93119
I am trying to delete certain text that appears before / on every line.   I have something like:  testing.db.com/7fad416d-f2b3-4259-b98d-2449957a3123 testing.db.com/8a8589bf-49e3-4cd7-af15-6753067355c6   and I just want to end up with:   7fad416d-f2b3-4259-b98d-2449957a3123 8a8589bf-49e3-4cd7-af15-6753067355c6    Can anyone help me with a regular expression? Everything I have found is deleting after /, not before.
58935
S-123-P Bash Pocket Ref.        2010    Cengage Learning    $55 E-P234  Python Pocket Ref.      2012    Cengage Learning    $45 55-MNP  Unix System Programming 2001    Sybex               $230  I need to replace the numbers after the $ not including the $ with *, so the output need to be: S-123-P Bash Pocket Ref.        2010    Cengage Learning    $** E-P234  Python Pocket Ref.      2012    Cengage Learning    $** 55-MNP  Unix System Programming 2001    Sybex               $***  I've been able to replace the last digit or last 2, but not every digit after the $. I've tried sed and awk gsub but nothing I try seems to work.
34780
I want to know which files have the string $Id$.  grep \$Id\$  my_dir/mylist_of_files   returns 0 occurrences.  I discovered that I have to use  grep \$Id$ my_dir/mylist_of_files  Then I see that the $Id is colored in the output, i.e. it has been matched.  How could I match the second $ and why doesn't \$Id\$ work.  It doesn't matter if the second $ is the last character or not.  I use grep 2.9.    Before posting my question, I used google...       To search for a $ (dollar sign) in the file named test2, enter:      grep \\$ test2      The \\ (double backslash) characters are necessary in order   to force the shell to pass a \$ (single backslash, dollar sign) to the   grep command. The \ (single backslash) character tells the grep   command to treat the following character (in this example the $) as a   literal character rather than an expression character. Use the fgrep   command to avoid the necessity of using escape characters such as the   backslash.   but I don't understand why grep \$Id works and why grep \\$Id\\$ doesn't.  I'm a little bit confused...
70098
I'm trying to get a regex that will match:  somefile_1.txt somefile_2.txt somefile_{anything}.txt   but not match:  somefile_16.txt   I tried  somefile_[^(16)].txt   with no luck (it includes even the "16" record)
31301
I have some files and each files have distinct name but all of them have the same "-statement" at the end like this:  flower-statement.mp3 leave-statement.mp3  ball-statement.mp3 goal-statement.mp3   So I want to remove this: -statement  Is that possible?
113533
I'm trying to write a regex that will parse out the directory and filename of a fully qualified path using matching groups.  so...  /var/log/xyz/10032008.log   would recognize group 1 to be "/var/log/xyz" and group 2 to be "10032008.log"  Seems simple but I can't get the matching groups to work for the life of me.  NOTE:  As pointed out by some of the respondents this is probably not a good use of regular expressions.  Generally I'd prefer to use the file API of the language I was using.  What I'm actually trying to do is a little more complicated than this but would have been much more difficult to explain, so I chose a domain that everyone would be familiar with in order to most succinctly describe the root problem.