86,156 reputation
1094207
bio website
location European Union
age
visits member for 2 years
seen 11 hours ago

Aug
20
revised How to remove text matching specific patterns from a file
formatting
Aug
20
answered Redirecting loopback traffic through a router
Aug
20
comment Is there a shortcut for repeat the second proximate command in bash?
Use Ctrl+P in emacs mode (default), or k in vi-mode if you don't want to reach for the up key.
Aug
20
comment how to use dd to fill drive with 1's
@mikeserv, the pipes are 64kB large on current versions of Linux, that may be where you got that 64kB from.
Aug
20
comment Nexenta bash script uses /usr/sun/bin/sed instead of /usr/bin/sed
@csny, I would use POSIX syntax in your script. Both Sun (at least after PATH=$(getconf PATH):$PATH) and Gnu should be mostly POSIX compatible.
Aug
20
comment shell script for auto-touching files
See unix.stackexchange.com/a/110301/22565 (and also unix.stackexchange.com/a/149916/22565). -print0/-0 was a GNU only extension and is now supported by a few others. Note that with GNU xargs, you also need -r.
Aug
20
comment shell script for auto-touching files
It's not too much for the shell, it's too much for the system (for the execve() system call).
Aug
20
comment shell script for auto-touching files
Actually, while -execdir helps for rm, it doesn't help much for touch as touch will follow symlinks as well. Some have a -h. Best is to add a ! -type l otherwise.
Aug
20
comment shell script for auto-touching files
-exec {} + is standard and portable. For once, it was the GNU implementation that didn't support it until recently. Using -print | xargs is almost as bad as using command substitution. Would touch /etc/shadow if someone creates a file called "/tmp/ /etc/shadow" as well.
Aug
20
comment shell script for auto-touching files
In a world writeable dir like /tmp, find /tmp -execdir touch -c {} \; is safer (with find implementations that support it) (though a lot slower).
Aug
20
revised to compare two fields in two different files
formatting.
Aug
20
comment how to use dd to fill drive with 1's
@mikeserv, actually, using tee - - - does increase throughput significantly in my testing. That's going from 800MiB/s for tr (950MiB/s with stdbuf) to 2.3GiB/s with tee, like you say in any case way above the rate any current drive can sustain.
Aug
20
comment how to use dd to fill drive with 1's
@mikeserv, I think the only way to increase performance from that is to reduce the number of system calls made. tee won't help for that. stdbuf -o1M tr... may help.
Aug
19
revised how to use dd to fill drive with 1's
added 14 characters in body
Aug
19
comment Why are rmdir and unlink two separate system calls?
@Gilles, no, chroot() doesn't do a chdir(), so if your current directory was outside the jail before the chroot(), it still is after. That's why the literature always says to close your references to things outside the jail when doing chroot, otherwise you can escape the jail. (see man 2 chroot on Linux for instance, and you can try it for yourself)
Aug
19
answered Nexenta bash script uses /usr/sun/bin/sed instead of /usr/bin/sed
Aug
19
comment How could i flip content of a binary file with bash commands
@G-Man, more like "$(printf '\\%o' {255..0})" with zsh/bash/ksh93. Though, since it's always the same, there's no good reason you'd want to generate it every time.
Aug
19
answered how to use dd to fill drive with 1's
Aug
19
comment How could i flip content of a binary file with bash commands
What's a bash command?
Aug
19
answered How could i flip content of a binary file with bash commands