Tag Info

New answers tagged


You are asking the wrong question, or asking the question wrongly and in the wrong stack, this is a better question to ask in the programming/stack-overflow for people to give you answers based on the algorithms used inside awk and sort. PS: also do the needed with nawk, mawk and gawk to give us some more details to "zone into" ;) and do the runs like a 100 ...


The speed difference is because 'sort' is a command (link), whereas 'awk' is a programming language (link). 'sort' command is takes input and return output. Whereas 'awk' is a programming language, which first interprets the code (terminal command) then starts processing on it. Simple as that.


Here's a summary of some of the drawbacks of: cat $file | cmd over < $file cmd First, a note: there are (intentionally for the purpose of the discussion) missing double quotes around $file above. In the case of cat, that's always a problem except for zsh; in the case of the redirection, that's only a problem for bash or for some other shells only ...


You can use lightweight distributions that require less ram. Linux doesn't need 512MB. SWAP is kind of temporary substitution for RAM. You could use it, but it's much slower than RAM, and could make your experience unpleasant. Still, you can check out Puppy Linux requirements. It's known for being lightweight. Also, here you can see list of distributions ...


ulimit can be two things: a POSIX 7 C API interface that was deprecated in favor of getrlimit(): http://pubs.opengroup.org/onlinepubs/9699919799/functions/ulimit.html Applications should use the getrlimit() or setrlimit() functions instead of the obsolescent ulimit() function. This was not the case when sim answered on POSIX 6. On GNU/Linux, ...


tar --use-compress-program=pigz .... replace pigz with your favorite parallel compression program. The reason to use tar is because it can store the owner, group, permissions. That metadata is often useful (e.g., restoring a dir tree in a complex system).


I'm guessing your kernel doesn't see them as prioritary :) If you have a look at your image, you can see that your Python processes have a priority of 20. That's the default value. This means that if we take aside other scheduling factors (already-allocated CPU time, process state, ...), your Python scripts are considered just as important as top, rcu_shed, ...


As mentioned in a comment and without seeing any of your code or other information (which would not be on-topic here anyway) all I can say is your program appears to be IO bound. The means while your calculations could use more of your CPU, they are having to wait on data and spending many cycles waiting rather than calculating. This can be due to the way ...


That pretty much means your apps are IO bound--your hardrive/network, etc. can't keep up with your processor and consequently, the processor spends a lot of time waiting on IO data, not using its full potential. If the IO your apps depend on is the network and you aren't downloading at your full bandwith, you might get an efficiency increase by adding more ...


An alternative would be using ack which supports extended regex by default: ack "one|two" For case insensitivity use ack -i and for non-standard filetypes use ack --all.


grep -e foo -e bar -e baz files or: grep 'foo bar baz' files If those foo, bar, baz are meant to be strings as opposed to basic regular expressions, add the -F option to those 2 grep commands above. For extended regular expressions: grep -E 'foo|bar|baz' files If the list of strings is in the positional parameters ($1, $2...): NL=' ' IFS=$NL # or ...


egrep (or grep -E) can do OR: egrep "string|string|string" <file>

Top 50 recent answers are included