{"id":854,"date":"2021-02-09T00:42:22","date_gmt":"2021-02-09T08:42:22","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=854"},"modified":"2021-02-09T00:42:22","modified_gmt":"2021-02-09T08:42:22","slug":"152-listing-the-number-of-cpus-in-a-system-using-grep","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/152-listing-the-number-of-cpus-in-a-system-using-grep\/","title":{"rendered":"#152 Listing the number of CPUs in a system using grep"},"content":{"rendered":"<p>#152 Listing the number of CPUs in a system using grep<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ngrep -c name \/proc\/cpuinfo\r\n<\/pre>\n<p>Output:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n8\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#152 Listing the number of CPUs in a system using grep grep -c name \/proc\/cpuinfo Output: 8<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,20],"tags":[],"class_list":["post-854","post","type-post","status-publish","format-standard","hentry","category-bash","category-linux"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-dM","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":857,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/153-how-many-words-have-four-consecutive-vowels-using-grep\/","url_meta":{"origin":854,"position":0},"title":"#153 How many words have four consecutive vowels using grep?","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#153 How many words have four consecutive vowels using grep? The square brackets mean list. The search is for the letter a or e or i or o or u. Then we add the brace brackets at the end enables multipliers. Having just the number 4 in the braces indicates\u2026","rel":"","context":"In &quot;bash&quot;","block_context":{"text":"bash","link":"https:\/\/gantovnik.com\/bio-tips\/category\/bash\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":861,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/154-re-anchors-in-grep\/","url_meta":{"origin":854,"position":1},"title":"#154 RE anchors in grep","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#154 RE anchors in grep The ^ or carat represents the start of the line and the $ represents the end of the line. If we want to query for words that end with \"cord\" we will use: [code language=\"python\"] grep 'cord$' \/usr\/share\/dict\/words [\/code] Output: [code language=\"python\"] Concord accord concord\u2026","rel":"","context":"In &quot;bash&quot;","block_context":{"text":"bash","link":"https:\/\/gantovnik.com\/bio-tips\/category\/bash\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":900,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/162-loops-using-command-line-in-bash\/","url_meta":{"origin":854,"position":2},"title":"#162 Loops using command line in bash","author":"gantovnik","date":"2021-02-19","format":false,"excerpt":"With increment: [code language=\"python\"] $ for i in {1..20..2}; do echo $i; done [\/code] Output: [code language=\"python\"] 1 3 5 7 9 11 13 15 17 19 [\/code] [code language=\"python\"] $ for word in one two three; do echo $word; done [\/code] Output: [code language=\"python\"] one two three [\/code] C-like\u2026","rel":"","context":"In &quot;bash&quot;","block_context":{"text":"bash","link":"https:\/\/gantovnik.com\/bio-tips\/category\/bash\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":477,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/02\/extract-eigenvalues-from-nastran-f06-file\/","url_meta":{"origin":854,"position":3},"title":"#68 Extract eigenvalues from Nastran f06 file","author":"gantovnik","date":"2020-02-28","format":false,"excerpt":"grep -i -A 26 'R E A L E I G E N V A L U E S' my_fem.f06 > eigenvalues.txt","rel":"","context":"In &quot;bash&quot;","block_context":{"text":"bash","link":"https:\/\/gantovnik.com\/bio-tips\/category\/bash\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2219,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/06\/431-hypermesh-python-script-to-create-nodes-using-coordinates-from-csv-file\/","url_meta":{"origin":854,"position":4},"title":"#431 HyperMesh python script to create nodes using coordinates from csv file","author":"gantovnik","date":"2024-06-24","format":false,"excerpt":"Finally, I read how to write a script for HyperMesh in python. In this example, the script reads the coordinates of points from a cvs file. [code language=\"python\"] import os import hm import hm.entities as e from hwx import gui import csv model=hm.Model() os.chdir(r\"D:\\projects\\wordpress\\ex431\") with open('ex431_coordinates.csv', mode ='r') as file:\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/06\/ex431.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":544,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/05\/how-to-write-a-code-to-know-certain-elements-belongs-to-which-components\/","url_meta":{"origin":854,"position":5},"title":"How to write a code to know certain elements belongs to which components ?","author":"gantovnik","date":"2020-05-12","format":false,"excerpt":"How to write a code to know certain elements belongs to which components ? set comp_id [hm_getvalue elems id=$elem_id dataname=collector.id]","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=854"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/854\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}