Reputation
1,394
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
5 11
Newest
 Nice Answer
Impact
~124k people reached

Feb
13
awarded  Nice Answer
Jan
21
comment Set a network range in the no_proxy environment variable
Also, it should be 10.1.{0..255}.{0..255}, or at least 10.1.{0..255}.{1..255}. (I don't think the last bit can be 0 for "normal" devices, but I am not sure.)
Jan
21
comment Set a network range in the no_proxy environment variable
@dafrazzman: that could well be. After all, it's almost 800 kilobytes large, which is somewhat extreme for an environment variable. It also depends on how large your environment can be. For this extreme case, I would recommend the wrapper approach.
Dec
28
awarded  Nice Answer
Oct
11
awarded  Yearling
Oct
11
awarded  Yearling
May
23
comment How to report number of files in all subdirectories?
@toxalot: I didn't bother adding it as an answer because it was so short (and possibly slightly condescending in tone). Feel free to upvote the comment. :-) Also, the question is somewhat vague with regards to what "how many files" means. My solution counts "regular" files and directories; maybe the poster really meant "files, not directories". Another thing to keep in mind is that this globbing does not take "hidden" dot files into account. There are ways around both of those gotchas, though. But again: not sure of the original poster's exact requirements.
Oct
11
awarded  Yearling
Oct
11
awarded  Yearling
Sep
22
comment List X random files from a directory
Gilles: quite right, which is why I said "Note that neither version takes duplicates into account." You could still do it in pure Bash, if you do not care about time complexity and rebuild the array each time you remove a random one from it. Not even close to a one-liner, then, but of course that was not a requirement.
Sep
18
comment List X random files from a directory
This is the quick and dirty way, and I would use it, too — for a one-off script. For anything more durable, avoid parsing the output of ls.
Sep
18
answered List X random files from a directory
Jul
19
comment Difference between “echo $SHELL” and “which bash”
Allow me to spamvertise the wtfis function from my dotfiles: github.com/janmoesen/tilde/blob/01a9f86/.bash/commands#L719 — it combines type, file and ls to show as much information as possible.
Jul
16
comment Piping in awk scripts
If you would still like to build your own, you might want to have a look at stat and build the desired output yourself, instead of tweaking the output of ls.
Jul
16
answered Execute remote script with local parameter value
Jul
16
comment Execute remote script with local parameter value
Note that if $myparameter contains spaces, it will split on the server side. Bash's printf has a %q format that you could use. I have some example code, but it does not fit here. I'll create a new answer for it.
Jul
5
answered is there any command like “wall” that runs a “command” in all terminals
May
31
answered Execute on the basename of a find command
Mar
29
comment using watch with ssh
Never mind my answer. The forced pseudo-tty allocation is much easier.
Mar
28
answered Why does sftp hide the log from stdout?