All Questions
10
questions
0
votes
3
answers
80
views
script using linux command to search word
I have the file, In the file data few lines have only one word, if such a case is present i want to print following line as the present line
can I get some tips for this
grep -E "module" ...
1
vote
4
answers
149
views
Sed delete everything before and after characters
I'm running on android this
Command:
dumpsys activity activities | grep mFocusedApp
Output:
mFocusedApp=ActivityRecord{273535b u0 com.any.some/.app.AnyActivity t5595}
Expected:
com.any.some
I need ...
6
votes
4
answers
1k
views
Command that copy files with given time stamp
We need a command that copy files from current directory to another with given date.
-rw-r----- 1 schmidt schmidt 276423 set 03 10:31 'event01.csv'
-rw-r----- 1 schmidt schmidt 283861 set 03 10:34 '...
0
votes
2
answers
146
views
How to delete string other than pattern?
I have a m3u file as below. I want to delete all strings except the pattern and next first line. or save the pattern and the next first line as another file.
Patterns group-title="TR ULUSAL" , group-...
0
votes
4
answers
795
views
grep and cut text from unstructured file?
From below 3lines I need to grep and cut jar file name only.
How to grep jar name from the line and cut from there.
Downloading:https://repo.maven.apache.org/maven2/org/springframework/spring-aop/5....
-1
votes
2
answers
456
views
How to print the first line which include special word [closed]
Print the first 123 below XXX
AAA
BCB
DDD
123
123
XXX
CCC
123
123
MSM
123
1
vote
1
answer
160
views
how to change text string with shell script
/home/temp.txt
http://url_new_address.com
/home/list.txt
URL http://url_address.com:URL1
URL http://url_address.com:URL2
URL http://url_address.com:URL3
How can I replace the line in temp.txt with ...
0
votes
2
answers
4k
views
Cat a file with grep, showing current "cat" line
I search through a HUGE file with cat and grep. I need to know on which line is cat all the time.
If i want to search ball:
cat file.txt | grep ball
FILE:
football
tennis
hockey
basketball
...
...
7
votes
5
answers
14k
views
What the equivalent of "grep | cut" using sed or awk?
Say I had a config file /etc/emails.conf
email1 = [email protected]
email2 = [email protected]
email3 = [email protected]
and I wanted to get email2
I could do a:
grep email2 /etc/emails.conf | ...
1
vote
3
answers
1k
views
Cat 2 files and avoid duplication of lines
I have the file1 with the following content
{"name":"clio5", "value":"13"}
{"name":"citroen_c4", "value":"23"}
{"name":"citroen_c3", "value":"12"}
{"name":"golf4", "value":"16"}
{"name":"golf3", "...