Claim your Biolink Click Here
3 like 0 dislike
238 views
I have a file with conf extension with the below content

[ {agent, "xyz://BC:abc@10.0.0.1"}
[ {agent, "xyz://BC:abc@10.0.0.1"}  % content

And I need to extract the IP 10.0.0.1
in Education & Reference by (820 points) | 238 views

1 Answer

1 like 0 dislike
Best answer
grep 'xyz://BC:' /pathtofile/*.conf | cut -d'@' -f2 | cut -d'"' -f1|head -1
by (4.7k points)
0 0
Explanation:
Syntax:
cut OPTION... [FILE]...
-d, --delimiter=DELIM   # use DELIM instead of TAB for field delimiter
-f, --fields=LIST       # select only these fields;  also print any line that.
> head: to see the file from top and 1 means first line

Related questions

1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,314 questions
1,476 answers
569 comments
4,809 users