Skip to content

The domain and search options in resolv.conf

Let’s say you have a resolv.conf file that’s something like this. Then let’s say you just changed it to this. Would these both do the same thing? Is one slightly better than the other? Why would declaring both a domain and search not be recommended? Answer The existence of both keywords are …

replace text between two tabs – sed

I have the following input files: and I am trying to find the second string between the two tabs (e.g. text2, abc2) and replace it with another word. I have tried with but it only deletes the tab and does not replace the word. I appreciate any help! Answer I would suggest using awk here: Set the input and out…

Stopping an unknown process in linux server

I have this command in my deployment process. But I want this process to stop and then restart while deploying in linux server. I checked and found that this is simply a JAVA process, and I can’t simply kill JAVA as other nimbus and supervisors are running too. So, how can I stop this process? Answer Yo…

How to keep 2 history files? One with timestamp, the other without

The reason I want to achieve this, is because I’d like to remove duplicates for easier command retrieval on the one hand, while still having the option of going over everything along with the timestamp, in case something bad happens, and perhaps going over what commands I executed can help somehow. Here…

sleep 0 has special meaning?

I’m seeing a lot of usages of sleep 0 in my one of my client project. The code look something like this. Reading through some of the answer of SO like this it seems that sleep 0 has some significance. What I want to known now is that does scheduling for other thread to run (if they are waiting to

How to replace recursively part of file name in bash

I have a directory having subdirectories containing images files with a wrong name such like filename.jpg.jpg i want to replace this recursiveley with filename.jpg i have tried: or but none works thank you Answer If you have a rename utility which uses perl regular expressions, then use the below command :