Differences

This shows you the differences between two versions of the page.

Link to this comparison view

shell [2018/04/24 11:19]
dblume [Retrieving Symbols with addr2line]
shell [2018/12/14 10:33] (current)
dblume [jq Tips]
Line 387: Line 387:
 done done
 </code> </code>
 +Alternatively, to see the RSS use of that process alone: 
 +<code bash> 
 +while true; do sync; cat /proc/$(pidof yourprocess)/status | grep VmRSS; sleep 1; done 
 +</code>
 ====== Measuring Available Memory ====== ====== Measuring Available Memory ======
  
Line 465: Line 468:
 I ran the following P4 command to find out who's been editing a file recently: I ran the following P4 command to find out who's been editing a file recently:
  
-    $ find . -name fname.cpp | xargs p4 filelog -s -m 10 | grep -P "^\.\.\. #" | awk '{print $9}' | cut -d @ -f 1 | sort | uniq -c | sort -nr+   $ find . -name fname.cpp | xargs p4 filelog -s -m 10 | grep -P "^\.\.\. #" | 
 +     awk '{print $9}' | cut -d @ -f 1 | sort | uniq -c | sort -nr 
 + 
 +====== jq Tips ====== 
 + 
 +jq is really handy. Here's a tip for some processing I often do: 
 + 
 +<file javascript fruits.txt> 
 +{ "fruits": 
 +  { 
 +    "apple": 
 +       { 
 +          "name": "Apple", 
 +          "price" : 2 
 +       }, 
 +    "banana": 
 +       { 
 +          "name": "Banana", 
 +          "price" : 3 
 +       }, 
 +    "count": 2, 
 +    "open": true 
 +  } 
 +
 +</file> 
 + 
 +<code> 
 +$ jq '.fruits|del(.count,.open)|with_entries(.value |= .price)' fruits.txt 
 +
 +  "apple": 2, 
 +  "banana": 3 
 +
 +</code>
 ====== Additional Keywords ====== ====== Additional Keywords ======
  
 Linux, Unix, *nix Linux, Unix, *nix
shell.1524593980.txt.gz · Last modified: 2018/04/24 11:19 by dblume
 
Recent changes RSS feed Driven by DokuWiki