How can I find all files containing specific text (string) on Linux?

Do the following: grep -rnw ‘/path/to/somewhere/’ -e ‘pattern’ -r or -R is recursive, -n is line number, and -w stands for match the whole word. -l (lower-case L) can be added to just give the file name of matching files. -e is the pattern used during the search Along with these, –exclude, –include, –exclude-dir flags … Read more

How can I get the source code for the linux utility tail?

The tail utility is part of the coreutils on linux. Source tarball: ftp://ftp.gnu.org/gnu/coreutils/coreutils-7.4.tar.gz Source file: https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tail.c (original http link) I’ve always found FreeBSD to have far clearer source code than the gnu utilities. So here’s tail.c in the FreeBSD project: http://svnweb.freebsd.org/csrg/usr.bin/tail/tail.c?view=markup

Signing Windows application on Linux-based distros

You can try osslsigncode To sign an EXE or MSI file you can now do: osslsigncode sign -certs <cert-file> -key <der-key-file> \ -n “Your Application” -i http://www.yourwebsite.com/ \ -in yourapp.exe -out yourapp-signed.exe or if you are using a PEM or PVK key file with a password together with a PEM certificate: osslsigncode sign -certs <cert-file> … Read more

How do I compile and link a 32-bit Windows executable using mingw-w64

That depends on which variant of toolchain you’re currently using. Both DWARF and SEH variants (which come starting from GCC 4.8.0) are only single-target. You can see it yourself by inspecting the directory structure of their distributions, i.e. they contain only the libraries with either 64- or 32-bit addressing, but not both. On the other … Read more

Does linux schedule a process or a thread?

The Linux scheduler (on recent Linux kernels, e.g. 3.0 at least) is scheduling schedulable tasks or simply tasks. A task may be : a single-threaded process (e.g. created by fork without any thread library) any thread inside a multi-threaded process (including its main thread), in particular Posix threads (pthreads) kernel tasks, which are started internally … Read more

Difference between shell and environment variables

Citing this source, Standard UNIX variables are split into two categories, environment variables and shell variables. In broad terms, shell variables apply only to the current instance of the shell and are used to set short-term working conditions; environment variables have a farther reaching significance, and those set at login are valid for the duration … Read more

Application control of TCP retransmission on Linux

Looks like this was added in Kernel 2.6.37. Commit diff from kernel Git and Excerpt from change log below; commit dca43c75e7e545694a9dd6288553f55c53e2a3a3 Author: Jerry Chu Date: Fri Aug 27 19:13:28 2010 +0000 tcp: Add TCP_USER_TIMEOUT socket option. This patch provides a “user timeout” support as described in RFC793. The socket option is also needed for the … Read more

tech