New answers tagged search
0
Recoll can be built with no GUI and will search your document types from the command line.
2
Recoll can search PDFs. It doesn't support regular expressions, but it has lots of other search options, so it might fit your needs.
3
With exiftool:
exiftool -q -r -if '$ImageHeight == 500 &&
$ImageWidth == 500' -p '$Directory/$FileName' /some/dir
3
You can use the identify command that's part of ImageMagick to do this:
$ identify rose.jpg
rose.jpg JPEG 640x480 sRGB 87kb 0.050u 0:01
The 640x480 is the dimensions of the image, rose.jpg.
Using the find command you could do something like this:
$ find somedir -iname '*.jpg' -exec identify {} \;
So for your example:
$ find somedir -iname '*.jpg' ...
1
Depending on your Unix/Linux Flavor you can easily use slocate/mlocate/all the derivates.
Usually u can just hit updatedb as root and then do
locate <searchpattern>
Hitting updatedb again will update your present db and reflects the changes on the fs.
1
find . -type f -exec sed -r -i "/textword/d" {} +
Remember that the search text is interpreted as a regexp by sed (with the -r option), so it might need escaping.
Use sed -i.backup to backup original files as <filename>.backup.
1
With GNU find and sed you could:
find . -type f -print0 | xargs -0 sed -i '/^FIND$/d'
2
If your grep supports it; you could do a check by grep.
grep -P '\x00{NNN}' File
Where NNN is how many continuously zero bytes you want to match.
Would typically be max USHRT_MAX or 65535.
-P is needed to use \x00
To list offsets use:
grep -Pboa '\x00{NNN}' File
So something in the direction of:
for f in *; do
[ -e "$f" ] || break
if grep ...
3
The following should work, updated to strip white space:
#!/usr/bin/awk -f
# NR is the current line number (doesn't reset between files)
# FNR is the line number within the current file
# So NR == FNR takes only the first file
NR == FNR {
# Mark the current line as existing, via an associative array.
found[$0]=1
# Skip to the next line, so we ...
4
In vim just press * to search forward ... # will search backwards.
Oh: prepend * and # with g to also match partial words.
Top 50 recent answers are included


