Skip to content
Advertisement

Tag: grep

dont understand Linux command

I’m working on existing php project and I’m totally beginner with that . I ‘m trying to understand this line of code . I’ve searched alot and I know that exec is used to run unix command . But I don’t understand the first part /usr/local/sbin/clog ‘/var/log/filter.log’ I also dont understand | meaning here also I don’t understand this part

echo printing working directory files names for no reason

why echo printing the files names ? gives this output but running pacmd list-sinks | grep “index:” in the shell gives * index: 1 index: 2 index: 3 Answer pacmd returns * pattern. In for … in …; do … done loop, the list pattern contains * without any protection. So, bash replace * by all files found in current

Linux find xargs command grep showing path and filename

find /folder/202205??/ -type f | xargs head -50| grep ‘^Starting’ There are 20220501 20220502 20220503 and so on folders… This command searches all first 50 lines of all files in ‘/folder/202205??/’ and shows the lines beginning with text “Starting” I haven’t the path and the filename of the files that are matched by the grep command. How can I get

grep all .js urls from text file

There is a File a.txt I want to grep all .js extension URLs so I tried this but it not showing https://site.tld/b.js?query=1 And when I tried this, It also select js name from anywhere Thanks in advance Answer Just escape the . with a

grep AND Operations

I want to simulate AND operation in grep . List all the file files contains “Some Words” and contain “Some Other Words” anywhere in the file. So far I tried # but it is not working. Answer Using GNU tools: The first grep lists files (-l) containing string1 -i: case insensitive, -r: recursive, -Z: file list delimited by ascii null

Advertisement