Reputation
71,155
Next tag badge:
928/1000 score
307/200 answers
Badges
12 106 195
Newest
 Good Answer
Impact
~4.3m people reached

3h
comment Sed command for performance improvement or tr command for the same
@Azhar please edit your question and give us an example of your input and desired output as I requested. That way, we can know exactly what you need. Make sure to include examples of all the characters/strings you want to remove. Note, however, that if you want to modify several files of ~30GB size, it will be slow no matter what you do.
4h
comment Unable to create Kali Linux bootable USB with Windows10/Ubuntu
@vipin8169 you can provide links with this format: [link text](http://example.com). However, if you feel you have to, you should probably add them to your question instead.
21h
comment Unable to create Kali Linux bootable USB with Windows10/Ubuntu
Comments are not for extended discussion; this conversation has been moved to chat.
21h
comment Sed command for performance improvement or tr command for the same
Please edit your question and include i) an example of your file; ii) the output you would like from that example and iii) an explanation of exactly what characters you want to remove. What is ' supposed to be, for example?
21h
revised Sed command for performance improvement or tr command for the same
added 42 characters in body
21h
reviewed Edit Sed command for performance improvement or tr command for the same
21h
revised Sed command for performance improvement or tr command for the same
formatting
22h
revised How can I get the amount of available memory portably across distributions?
Added a command to actually print it
1d
comment CentOS 7 Full Partition Size Not Available
I'm afraid that cross-posting is frowned upon network-wide. That's not necessarily my personal position but that's the community consensus. As for accepting, no worries, I just wanted to point out that you can/should accept. Perhaps you didn't know. Anyway, this wasn't a reprimand, just regular clean-up.
1d
accepted How can I get the amount of available memory portably across distributions?
1d
comment CentOS 7 Full Partition Size Not Available
Please don't post the same question on multiple Stack Exchange sites. Also, if the answer you received on SU was excellent, please accept it.
1d
comment How can I get the amount of available memory portably across distributions?
Ah, good, so at least it should be portable across the same kernel version. That's something. I'm testing your suggestion with awk -v low=$(grep low /proc/zoneinfo | awk '{k+=$2}END{print k}') '{a[$1]=$2}END{m=a["MemFree:"]+a["Active(file):"]+a["Inactive(file):"]+a["SRecla‌​imable:"]; print a["MemAvailable:"],m-low}' /proc/meminfo which should give me the same number printed twice. However, the second number (my understanding of the algorithm you suggest) is higher than the MemAvailable shown in /proc/meminfo. What am I doing wrong?
1d
asked How can I get the amount of available memory portably across distributions?
1d
awarded  Good Answer
2d
comment Can I compare the parameter of a script to an array of variables and process it?
@cat I rolled back your edit since your indentation didn't make much sense. The OP has essentially posted pseudocode (there's no fi, the various if should probably be elif etc) and your indentation made even less sense since it looked like there were nested contradictory if clauses.
2d
revised Can I compare the parameter of a script to an array of variables and process it?
rolled back to a previous revision
2d
comment Can I compare the parameter of a script to an array of variables and process it?
Please edit your question and clarify what will be in the array and what in the individual $urlN variables. What are the "expanded values"? Do you want the user to enter www.example.com and your script to retrieve a value linked to that URL? Or do you want your user to enter a string and the script to retrieve the URL associated with that script? Are you thinking of having your user enter the string url1 and have that expanded to $url1 in your script?
2d
comment Font list update
I don't have one. I was hoping fc-cache would do it.
2d
comment How to remove date format
@Sai you need both -E and -i and the right format. Try this: sed -i -E '/([0-9]+-[0-9]+-[0-9]+|=+)/d' file
Feb
9
comment Best way to use a shell with Cygwin in Windows 7
Could you expand this a little please? Perhaps explain what features make this useful? As it stands, this is more of a comment than an answer.