8,126 reputation
12241
bio website cyrus-and.github.io
location Italy
age 28
visits member for 3 years, 11 months
seen 2 hours ago

minimal


22h
comment Remove a certain line from Bash history file
@chiliNUT: Just start your command (e.g. vim ~/.bash_history) with a space; commands starting with a space usually don't get logged (see $HISTCONTROL).
Mar
6
comment Bash Script to repeat every word in a line?
Shorter: sed -r 's/\S+/& &/g'.
Jan
9
comment Can one redirect too much data?
My concern would rather be how to handle a 50GB file...
Dec
24
comment Remove all *.foo in directory tree
@user877329, I see your point, but in my experience these tools are good for getting things done quickly and easily, but if you need to do it right then you often have to start developing your own tool.
Dec
24
comment Remove all *.foo in directory tree
@user877329, there's the -exec action that can be used for that purpose.
Dec
23
comment Remove all *.foo in directory tree
@Rob, man find: If no paths are given, the current directory is used.
Dec
1
comment What is the Discard Protocol actually used for?
Really?
Jun
2
comment Filter file when a column is in whitelist
Ahhh, yes, because I was testing with numbers...
Jun
2
comment Filter file when a column is in whitelist
Sorting a 20 million lines file takes about 30s on my machine.
May
1
comment How to create files named after lines in a text file under Linux
Redirection is integrated in Bash, there's no need to use cat here. If you prefer you can write the redirection before the command: < list.txt while .... Can you elaborate "but it also behaves a lot more predictably"?
Apr
13
comment Bash completion makes bash start slowly
I don't know if time bash -lc true works properly here since true finishes before ~0.1s so it doesn't source anything. Anyway time source /etc/bash_completion reports ~0.17s here and that's about the time I need to wait for the PS1 appear.
Mar
3
comment Get the current/default value of TCP initcwnd on Linux
+1, that web site is pretty useful.
Mar
3
comment Get the current/default value of TCP initcwnd on Linux
Yes, grepping the code is always a good idea!
Feb
15
comment invert colors on X (or xfce4)
xcalib supports the -s, -screen option that may be useful.
Jan
28
comment extracting words using awk
I'm assuming that each line is in the form: /^FG=[0-9]{4}$/. The OP doesn't state it explicitly. Anyway I'll update my answer to reflect that case too.
Jan
28
comment extracting words using awk
And indeed I didn't use a space in my example, what makes you think that this solution requires a space? Since you tagged your question unix I can think about some differences with the Linux version (that I'm using).
Jan
11
comment How does the tmux color palette work?
My tmux (1.6) accepts even colors like colour12 (mind the "u").
Nov
27
comment Ubuntu: Keep emacs in the terminal
I don't think so, with that alias emacs myfile is the same as emacs -nw myfile and that's perfectly legit since -nw gets parsed as an option.
Nov
26
comment Find file matching extension, then count files in the found directory
You should quote *.c.
Nov
4
comment Debian Bluetooth headphones not working
No, it turns out that the headset itself was buggy, another one worked correctly even with the Bluetooth v1.1 dongle.