10,648 reputation
12855
bio website
location
age
visits member for 3 years
seen 1 hour ago

2d
answered how does hdparm calculate spin-down times?
Dec
11
awarded  Enlightened
Dec
11
awarded  Nice Answer
Dec
3
answered Is there a way to do a “full file buffering” inside a chain of piped commands?
Nov
27
awarded  Yearling
Nov
25
comment trash and restore script - issue restoring
Not intending to spoil your programming fun, but there is already a freedesktop.org compatible command line implementation of a trash can. It's Python, though.
Nov
25
comment Change Text File Encoding without knowning the source encoding
If the encoding is unknown the file can't be converted (at least not for the general case). The same byte sequence might be valid in different encodings and represent different characters. This question boils down to finding the encoding of a text file.
Nov
25
comment How to change double hyphen to single hyphen of file names?
It matches one or more of the preceding expression (the character -).
Nov
25
answered How to change double hyphen to single hyphen of file names?
Nov
23
awarded  Good Answer
Nov
21
awarded  Nice Answer
Nov
21
answered How to prevent `mv` from moving a collection of files into a single regular one?
Nov
19
comment unlimited tmpfs
Then your system will seize up. Without either RAM or swap your system is unable to operate. You should prevent that from happening by limiting the size of the tmpfs. As @Mat already mentioned, since you appear to aim for something strange you should describe the problem you're trying to solve.
Nov
19
comment unlimited tmpfs
The system will swap out the data to the disk.
Nov
19
comment unlimited tmpfs
What do you mean by “limited to its small size”? You can make the tmpfs as large as it needs to be, even larger than your RAM, if required.
Oct
23
comment grep on a variable
Since the OP wants to count the number of occurrences of a string you can add a wc to complete the task: grep -o <string> <<< "$variable" | wc -l
Oct
23
answered Simultaneously calculate multiple digests (md5, sha256)?
Oct
23
comment Simultaneously calculate multiple digests (md5, sha256)?
If you're worried about the disk cache, you can read in the file just once: for i in file1 file2 …; do tee < "$i" >(sha256sum) | md5sum ; done Then you have to add additional code to mark the file name, because it is sent as standard input to md5sum and sha256sum.
Oct
23
comment Simultaneously calculate multiple digests (md5, sha256)?
You can just start one instance in the background, then both hashes run in parallel: for i in file1 file2 …; do sha256 "$i"& md5sum "$i"; done
Oct
21
awarded  Enlightened