Тёмный

search lines in files and standard output | grep command in linux | family of grep commands 

Pedagogy
Подписаться 7 тыс.
Просмотров 13 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@amitlondhe3651
@amitlondhe3651 2 года назад
Very good and clear explanation video. Thank you
@MrVisheshsingh
@MrVisheshsingh 3 года назад
Thank you for sharing!
@PedagogyV
@PedagogyV 3 года назад
welcome :)
@jalandharbehera8109
@jalandharbehera8109 3 года назад
Thank you so much sir.....I am so happy 🙏🙏🙏
@PedagogyV
@PedagogyV 3 года назад
welcome..and stay happy :)
@narayanaswamy9596
@narayanaswamy9596 2 года назад
Hii, your lectures are very simple and too good. In "20.0.RELEAESE" I want to grep only 20 from out of commented text. could you help me with this..
@boggarapulokesh3224
@boggarapulokesh3224 3 года назад
Hey. I want to know whether i can compare two files line by line and print matching lines to a new file. I have tried using foreach loop. But didn't work. If possible let me know how i can do this using foreach loop. Thanks
@PedagogyV
@PedagogyV 3 года назад
stackoverflow.com/questions/373810/unix-command-to-find-lines-common-in-two-files here , is your answer
@boggarapulokesh3224
@boggarapulokesh3224 3 года назад
@@PedagogyV No. That doesn't work. Comm - 12 works for small strings. Not for entire lines. The content in 2 files that I'm comparing is like this. /shsvbs/clkc-r4738-sbs/sguahvs-refy_jegbsk/. Only bigger. Each and every line in file1 is unique and has around 1000 lines. Same for the file2 as well. But some lines in both files match. So comm - 12 doesn't do at all. Have to use foreach or some other loop to compare 2 files line by line and output the matching lines to a 3rd file.
@PedagogyV
@PedagogyV 3 года назад
@@boggarapulokesh3224 Not sure why it is not working in your case. If possible , could you pls send these two file in telegram group, so that I can look into the problem and provide you some solution.
@boggarapulokesh3224
@boggarapulokesh3224 3 года назад
@@PedagogyV These are work files. So i can't send original files. But i can create and send sample files. What's your telegram in app name?
@PedagogyV
@PedagogyV 3 года назад
@@boggarapulokesh3224 yes, that will be great . The link for telegram will be in description of video.
@sajinprasad8711
@sajinprasad8711 2 года назад
Thanks bro
@RajRoy-wb1iz
@RajRoy-wb1iz 3 года назад
Hi... How can we grep certain numbers of line (say 10 lines) from a file and then print it in another file
@PedagogyV
@PedagogyV 3 года назад
for any set of lines you can use first sed command. ex :- sed -n '2,12p' filename : it will print line 2 to line 12 of file . after that use grep within this range , i.e sed -n '2,12p' file | grep word :- it will grep within this range of line and print them . now , if you want to send the output to a file instead of printing , use redirect i.e sed -n '2,12p' file | grep word > file2 :- it will redirect output to the file instead of printing. hope , this will help :) Not sure , why youtube is marking line over some of my comment , but take it as no line is marked on any comment.
@adammohammed4959
@adammohammed4959 2 года назад
how do I grep a file for lines containing the shell and display the output
@Yogeshkumar-dc2cr
@Yogeshkumar-dc2cr 3 года назад
how can i use grep -v in a file in foreach collection cmd
@PedagogyV
@PedagogyV 3 года назад
sry , didn't get "foreach colleaction cmd"..could you elaborate ?
@Yogeshkumar-dc2cr
@Yogeshkumar-dc2cr 3 года назад
@@PedagogyV I have 1 file in which I have to perform grep -v "pattern" 3 4 times So I want to do via script. It's like if I source in outcomes without performing grep 3 4 times.
@PedagogyV
@PedagogyV 3 года назад
@@Yogeshkumar-dc2cr you can use shell scripts and loop 3.. 4 time .. create an array first with index values like arr=("pattern1" "pattern2" "pattern3") for a in ${arr[@]} do grep -v ${a} dafile done in case it didn't work , please explain in telegram group
@beastavinash4655
@beastavinash4655 2 года назад
Bro do you have notes of this?
@PedagogyV
@PedagogyV 2 года назад
sadly...no
@beastavinash4655
@beastavinash4655 2 года назад
@@PedagogyV oke bro
@shokhrukholimjonov5231
@shokhrukholimjonov5231 Год назад
Thank you it was very beneficial but stop using ok to much
@PedagogyV
@PedagogyV Год назад
its stopped in future videos
@kunalmahajan9665
@kunalmahajan9665 2 года назад
If two words are in same sentence its would be display only those sentence and I want to know if we can search two words at a time in file that should display the only sentence For eg:- What is your name? My name is Ram Ram is my name Ram what are you doing Question :- search ram and name and display only those sentence. Not all containing single words. Output :- My name is Ram Ram is my name
@PedagogyV
@PedagogyV 2 года назад
Hi, we can use multipl grep.. cat filename | grep Ram | grep name
Далее
Шоколад приходит на Землю.
00:23
Просмотров 160 тыс.
Тестирую гаджет для роллов! 🙈
00:42
🎙ПОЮ ВЖИВУЮ!
3:07:23
Просмотров 914 тыс.
Xargs Should Be In Your Command Line Toolbag
16:24
Просмотров 100 тыс.
The most powerful Linux Command
12:52
Просмотров 3,5 тыс.
Where GREP Came From - Computerphile
10:07
Просмотров 940 тыс.
Шоколад приходит на Землю.
00:23
Просмотров 160 тыс.