I need to GREP second column (path name) from the text file. I have a text file which has a md5checksum filepath size . Such as: the above is the text file, I used grep -Eo ‘[/]’ file.txt but it prints only / , but i want the output like this: Lastly I have to use GREP. Answer If you
unix command to search count of 5XX status HTTP requests in the log
i need to write a unix command to search count of 5XX status HTTP requests in the log. Log format is like below example : any suggestions ? Answer A minimal solution would be grep will filter the output to only the lines including the string 5XX, where X is any digit character. This output is then piped to wc
Shell Script to extract only file name
I have file format like this (publishfile.txt) I just want to extract the name OMEGA****, sample, sample(1) How can I do that I have used basename in my code but it doesn’t work in for loop. Here is my sample code But this code also doesn’t wor when used outside for loop Answer This simply says th…
Filling empty spaces in a CSV file
I have a CSV file where some columns are empty such as How do I replace all the empty columns with the word “empty”. I have tried using awk(which is a command I am learning to use). I want to have I tried to replace just the 3rd column to see if I was on the right track this left
Any way to ensure that no more than x HTTP requests are sent to a certain site in Linux?
I am using Docker, base image is alpine. I have an application that sends HTTP GETs to a certain site but I have a limitation, after 50 requests I have to pay some amount per request and I want to avoid that. I will also impose some sort of hard stop from the application code but I wanted to know
definition of linux perf cache-misses event?
I am trying to use linux perf to profile cache performance. perf list shows there is a cache-misses event. However, what’s the definition of this “cache-misses” event? Is it one of L1D/L1i cache, L2 cache or L3 cache? Thanks! Answer The cache-misses event corresponds to the misses in the las…
TensorFlow MirroredStrategy() not working for multi-gpu training
I am trying to implement TensorFlows MirroredStrategy() to run a 3DUNet on 2 Nvidia Titan RTX graphics cards. The code is verified to work for 1 GPU. My OS is Red Hat Enterprise Linux 8 (RHEL8). The error comes at model.fit(). I have installed the appropriate NCCL Nvidia Drivers and verified that I can parse …
PHP-FPM can’t access files in home directory — stat EACCES — “File not found”
I recently updated PHP-FPM to version 7.4.2 (on Arch Linux) and noticed it stopped working (everything was fine before) by responding “File not found” to all clients. The process, and also nginx, run under my personal user account (kevin UID 1000). Nginx serves static content from my home director…
Why is there a “gap” beween the variables that I initiated in the stack?
I’m trying to play around with a buffer overflow. When the program counter gets to if(modified != 0), the base pointer is 0x00007fffffffdfe0. Right below the base pointer, I see 4 bytes that contains integer 0 which makes sense. However, the buffer is not right below the int modified. It looks like 4 by…
Copy a folder contents and save the file with diff name Unix
I have a bunch of .txt files in a directory. I m looking for a command to copy all .txt files and save it with <filename>_2.txt. Eg: abc.txt -> abc_2.txt (After copy) Thanks in tons in advance Answer EDIT: As per OP’s extension request adding following code now. Try following. Above will print …