New answers tagged


In Linux, you have strace: strace -f sh -c 'grep word1 file > file.txt' Here we use -f to tell strace to trace child process. In *BSD, you have dtruss (which use dtrace underlying): dtruss -f sh -c 'grep word1 file > file.txt' OSX has trace. Historical Unix systems have truss (Solaris, AIX, etc.).


If you want to prevent disk writes as much as possible, you can do this with Laptop Mode. One of the features of laptop mode is to allow a disk to spin down and to prevent the kernel from writing to it until memory gets full or until a timeout occurs (or until the disk needs to spin up in order to read data from it). See also the Arch Wiki. You'll presumably ...


sounds like a job for eatmydata ( ) in debian, try something like apt-get install eatmydata; printf "\" >> /etc/ reboot


For redirection, I would assume this (redirection) is implemented by the shell replacing stdin (by input for < input) and stdout (by output for > output) using dup2() - open files for input and output in = open() out = open() dup2(in, 0) // replace input file with stdin dup2(out, 1) // replace output file with stdout close(in) ...


"redirection" is a concept of the shell, and the details around it depend on which shell you are talking about. Though, one might say that the basis for redirection rests with the notion that programs have pre-opened input and output file descriptors when they start, which traces back to how the execve function works. Namely that the child process inherits ...

Top 50 recent answers are included