All Questions
34
questions
-1
votes
2
answers
136
views
Grep a log file for SQL queries and their execution time
I have an application log file that also captures the execution time for each executed SQL statement, like below:-
Sample logs:
I 2023-11-15 07:18:00.743Z 1760463 37 ZVRwqItu6aw-b8eejMLI_gAAAAU 1@...
1
vote
1
answer
231
views
command for multiple input and multiple output
I am performing some operations using the grep, sed, and cut commands on a Linux machinete:
zgrep -A1 "^module" *.v.gz | sed -n -e 's/^\(module \)*\(.*(.*)\).*$/\2/p' | cut -f1 -d"(&...
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
votes
2
answers
6k
views
AWK or grep with cut. Need help cutting a field
I have this file and need to cut field 3 which should be cut - f 3. Right? I am using this code and its absolutely not doing anything for me.
grep '^2014-' FileName | cut - f 3| less
1
vote
2
answers
86
views
Arranging the lines in required order
A file contains lines as follows:
acb/xyz/row<t>
acb/xyz/row<t>
abc/xyz/row<1>
abc/xyz/row<1>
abc/xyz/row<0>
abc/xyz/row<0>
abc/xyz/row<3>
abc/xyz/row<3>...
1
vote
4
answers
923
views
How can I get the lsblk-devices that are NOT in use
root@pve-virt-01:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 250G 0 disk
├─sda1 8:1 0 1007K 0 part
├─sda2 8:2 ...
1
vote
1
answer
49
views
Update data using search & replaces
get_data.txt
ald900 NON-Prod GOOG037-A US
ald9024 NON-Prod GOOG037-A SRI-LANKA
ald978 NON-Prod GOOG037-A JAPAN
I have two given data. I need to search in get_data.txt ...
0
votes
6
answers
415
views
Split each line by a delim read from another file and store all split word compounds in the result file
I want to split each line from file names by each and every delimiter from file delim and store the unique word compounds into result file compounds. Lines from names that were not split should be ...
0
votes
2
answers
167
views
How to filter only particular lines from a file?
I have a file which has following lines. I just was to see IP address which is the first line, second line country only once and the score line only once but the score line should be the highest value ...
0
votes
2
answers
748
views
Search a string on the specific columns using GREP/AWK/CUT
Kindly modify my script, because I want to search the word "dBm" in Column 1,3, and 4 of File.csv and return all unmatched lines/records 'cause "dBm" need to be deleted on the file.
cat File.csv | ...
2
votes
3
answers
2k
views
How to get single character after space?
How can I get below output? I want the first field as it is and a single character after space.
echo "Hello world"
Hellow
If it also has a 3rd field than the beginning character of the 3rd field ...
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
vote
1
answer
316
views
sed/awk/grep/cut: multiply a number in an xml-attribute by factor of ten
I would like to multiply the attribute in viewBox of svg-files by a factor of ten.
I want to change
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" version="1.1"> to <svg xmlns=...
5
votes
1
answer
360
views
cut command fields
I noticed these two different fields behaviors using cut command:
bash:~$ var=`cat /proc/cpuinfo | grep 'model name' | uniq | cut -d ' ' -f 3,4,5,6,7,8 `
echo $var
outputs
Intel(R) Core(TM) i7-...
4
votes
2
answers
841
views
Getting the last lines that matches a pattern in multiple files
I have an application that outputs a set of log files to a central directory like this:
/tmp/experiment/log/
├── node01.log
├── node02.log
├── node03.log
├── node04.log
├── node05.log
├── node06....