Reputation
154,762
Next tag badge:
768/1000 score
208/200 answers
Badges
23 237 421
Newest
 Necromancer
Impact
~8.4m people reached

Mar
14
comment Range arrays with custom step-size in Bourne shells
While {0..20} comes from zsh, AFAIK, {0..20..2} comes from ksh93. All 3 (zsh, ksh93, bash) implementations are different on several aspects. For zsh you want {0..20..-2} or {20..0..2} for backward ranges. Note that the seq method depends on the current value of IFS (and needs GNU seq).
Mar
14
revised Remove files with match only from some subdirectories
added 128 characters in body
Mar
14
answered Remove files with match only from some subdirectories
Mar
14
revised Sed from line 6 on from all txt files and being able to output all the results in a single file
edited body
Mar
14
comment Sed from line 6 on from all txt files and being able to output all the results in a single file
@Chris, I'd suggest asking a separate question for that.
Mar
14
comment how to delete (or keep) certain file extensions using busybox find?
@DmitryGrigoryev, there was no xargs then. Also, the persons using those systems at the time were usually the same as those writing software for them, and on a million $ system which was a privilege to be able to use, you wouldn't fool around creating filenames with spaces in them let alone newline, especially considering the max length of a filename was pretty short. The situation has evolved quite a bit since then.
Mar
14
revised Sed from line 6 on from all txt files and being able to output all the results in a single file
added 5 characters in body
Mar
14
revised Sed from line 6 on from all txt files and being able to output all the results in a single file
added 364 characters in body
Mar
14
comment Sed from line 6 on from all txt files and being able to output all the results in a single file
It also has security implications. You should never embed the {} in code arguments. That's enough of a known bad practice to deserve my downvote.
Mar
14
answered Sed from line 6 on from all txt files and being able to output all the results in a single file
Mar
14
comment Why did mv delete a file with mv id_rsa *.old?
ITYM most Bourne-like shells; the Thomson shell, csh, tcsh, zsh, fish don't leave the pattern unexpanded as it would be a silly thing to do (something broken by the Bourne shell)
Mar
14
comment how to delete (or keep) certain file extensions using busybox find?
@DmitryGrigoryev, actually the early Unix find implementations didn't take any option, all the -name, !... were added later on in the 70s.
Mar
14
revised how to delete (or keep) certain file extensions using busybox find?
added 440 characters in body
Mar
14
comment how to delete (or keep) certain file extensions using busybox find?
@DmitryGrigoryev (continued) what the OP's find might miss is support for -exec {} + which was added recently to busybox find.
Mar
14
comment how to delete (or keep) certain file extensions using busybox find?
@DmitryGrigoryev, hardly any find implementation supports -not (an extension added to GNU find in 2.0 in 1990, sometimes added later to other implementations like FreeBSD in 2002 for compatibility with GNU find). They all support ! though and have had since the very first version of Unix in 1970.
Mar
14
comment how to delete (or keep) certain file extensions using busybox find?
You can't post-process the output of find . unless you can make some assumptions on what characters the filename may contain. It's even worse when piping to xargs as in addition to newline, you'd also have problems with blanks, quotes and backslashes.
Mar
14
answered how to delete (or keep) certain file extensions using busybox find?
Mar
14
awarded  Nice Answer
Mar
14
comment Order of arguments to find
-mtime +74 has no effect because there's no action after that (and the presence of a -ls action predicate cancels the default -print action). If you had find . -ls -mtime +74 -print, all files would undergo -ls and the old ones -print.
Mar
14
revised What is the difference between virbr# and vnet#?
added 42 characters in body