1,383 reputation
1312
bio website
location
age
visits member for 1 year, 4 months
seen 18 hours ago

Jul
9
comment ls content of a directory ignoring symlinks
You could also use find ... -exec grep 'pattern' '{}' \+ -- using a plus instead of a semicolon tells find to pass as many files as possible to the grep, rather than limiting it to one file at a time. This will also be much more efficient, spawning fewer grep processes.
Jul
8
comment Removing a specific line from a file
ed answers always deserve a +1
Jul
2
awarded  Curious
Jun
1
comment rm -rf all files and all hidden files w/o . & .. error?
@CMCDragonkai that should be a different question, but you can find the solution in Gilles' answer (rm ..?* .[!.]* should do it).
Apr
20
comment How can I print out all but the last n characters in bash?
How does this work with multibyte characters, like UTF-8?
Mar
19
awarded  Yearling
Mar
18
comment The ls command is not working for a directory with a huge number of files
@Mikel More than that, I'm pretty sure that 5 million files is over the point where globbing will break entirely.
Mar
9
comment Check if $REPLY is in a range of numbers
AFAIK, Vorbis isn't a valid audio codec in an MP4 file (you want to use AAC or possibly MP3)...
Mar
8
comment Find the maximum length of characters in a field
@orion you can generally use <file.txt command_foo | command_bar rather than cat file.txt | command_foo | command_bar -- the < redirection doesn't have to go at the end of the command.
Feb
27
comment What happens in UNIX/Linux when a program is bigger then size of memory?
I would assume that embedded systems wouldn't have any programs that big.
Feb
9
comment Is there a command reverse search in vim?
I wish I could +10, having this feature makes using the vim command mode much nicer. I personally use a few remaps to make it easier to access.
Feb
4
comment Use of ls with wc command
Uch. +1 because you are entirely correct, but this ridiculous situation of allowing newlines in filenames is just... ugh.
Feb
4
comment Use of ls with wc command
@Kiwy most modern versions of ls automatically go to 'one file per line'-mode when the output is a pipe rather than an interactive terminal.
Jan
30
answered grep for string like xxx12345
Jan
30
revised How do I join the next line when a line matches a regex for whole document in VI?
added 1 characters in body
Jan
30
revised How do I join the next line when a line matches a regex for whole document in VI?
added 249 characters in body
Jan
30
answered How do I join the next line when a line matches a regex for whole document in VI?
Jan
24
comment rename files in batch
I think there is a difference on those edge cases where you have newlines in filenames. There's also probably a performance difference from that pipe, but that's not worth worrying about in practice.
Jan
24
comment rename files in batch
Why not for f in *.ogg rather than ls -1 | while read f? Apart from that, this is a good answer, probably what I'd do if my system didn't have (perl-)rename.
Jan
23
revised rename files in batch
added a big ol' explaination