Skip to content

Tag: linux

how can I diff two sections of the same file?

I have a source file with two similar yet subtly different sections. I’d like to merge the two sections into one subroutine with a parameter that handles the subtle differences, but I need to be sure I’m aware of them all so I don’t miss any. What I usually do in such cases is copy each of t…

Using Windows DLL from Linux

We need to interface to 3rd party app, but company behind the app doesn’t disclose message protocol and provides only Windows DLL to interface to. Our application is Linux-based so I cannot directly communicate with DLL. I couldn’t find any existing solution so I’m considering writing socket…

What is the safest way to empty a directory in *nix?

I’m scared that one day, I’m going to put a space or miss out something in the command I currently use: Is there a safer way of emptying the current directory’s contents? Answer The safest way is to sit on your hands before pressing Enter. That aside, you could create an alias like this one …

Network usage top/htop on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …

Maximum number of threads per process in Linux?

What is the maximum number of threads that can be created by a process under Linux? How (if possible) can this value be modified? Answer Linux doesn’t have a separate threads per process limit, just a limit on the total number of processes on the system (threads are essentially just processes with a sha…

ld cannot find an existing library

I am attempting to link an application with g++ on this Debian lenny system. ld is complaining it cannot find specified libraries. The specific example here is ImageMagick, but I am having similar problems with a few other libraries too. I am calling the linker with: ld complains: However, libmagic exists: Ho…