0
votes
1answer
15 views

Explain in details egrep line

Hi i found in the internet egrep line. The line founds the longest line in the text. But i dont understand specific elements. Maybe someone could explain me all line? Here it is: egrep -n "^.{$(wc -L ...
2
votes
2answers
71 views

Change text in many files

I have a C++ project, where each file has at its beginning some lines of license. Now, that my license have changed, I need to update it in each file. I don't want to do it manually, since its lots of ...
1
vote
4answers
93 views

Change directory structure from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY

I need to change my directory structure for my photos from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY I know this can sort of be done with exiftool, but it will only work on files containing EXIF-tags, and ...
1
vote
2answers
42 views

how can i find all files that contain embedded crc32's

how can I find all files that contain embedded crc32's e.g. Mydocument190_[F285E17D].pdf using the find command to clarify the crc32's are always within brackets [F285E17D] and the file names may ...
1
vote
1answer
66 views

How to get sub-string for a string using pattern analysis?

I want to get sub-string of any string using pattern analysis. Example String: <string module name="Jai" fathername="S.S. Khan" phone="1234"> <address complete="startz us" /> ...
0
votes
1answer
604 views

How to replace strings in file without regex?

I need to replace some strings in files (from command line) but I don't want to use sed -i because my string contains lots of funny characters which need to be correctly escaped. Is there a way to ...
1
vote
1answer
556 views

Grep Regex match not returning result as expected

I have several Ubuntu servers and there is some behavior that has me curious. On any newly installed machine (Ubuntu Server 12.04.3 LTS), if I run: echo "testbla123" | grep -P -o [0-9]* This will ...
2
votes
1answer
167 views

Delete lines starting with pattern from a file

I tried several commands: tr, sed but to no avail. Here's the file: > ... > ... > setEPS() > postscript('images/boxplot_default.eps') > ... > ... I want to delete those two ...
4
votes
3answers
290 views

bash escaping and find command

I trying to remove boring \-escaping from this command: find . \( -name '*.mp3' -o -name '*.jpg' \) -print by wrapping it in single quotes: find . '( -name *.mp3 -o -name *.jpg )' -print ...
1
vote
3answers
199 views

Simple way to get all .o files but one

I'm trying to link all *.o files from another folder and would like to in my Makefile do something like; g++ *.o (folder/*.o and not folder/main.o) -o bin Is there someway I can use somekind of ...
1
vote
5answers
4k views

How to programatically remove empty new lines from a file?

I need to remove empty new lines from text file in terminal. Example file 123 123 123 123 123 123 I've searched in google a bit but only solution found was sed '/^$/d' myFile > tt and it ...