{"id":24594,"date":"2021-04-12T23:10:05","date_gmt":"2021-04-13T03:10:05","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/topic-2-example-show-misc-info-about-a-machine-root\/"},"modified":"2021-04-12T23:10:05","modified_gmt":"2021-04-13T03:10:05","slug":"topic-2-example-show-misc-info-about-a-machine-root","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=24594","title":{"rendered":"Topic 2: Example: Show Misc info about a Machine #Root"},"content":{"rendered":"<p>bash-3.2$ cat echoscript.sh<br \/>\n#!\/bin\/sh<br \/>\n# This script will print useful information about the current machine.<br \/>\n# It will print the machine name, model type, specific processor<br \/>\n# information, and the current number of processes running.<br \/>\necho<br \/>\necho &#8220;The name of the machine is c&#8221;<br \/>\nuname -n # uname -n gives the hostname<br \/>\necho<br \/>\necho &#8220;The machine platform type is c&#8221;<br \/>\nuname -i # uname -i gives the hardware platform<br \/>\necho<br \/>\necho &#8220;Specific processor information for this machine is:&#8221;<br \/>\npsrinfo -v<br \/>\necho<br \/>\necho &#8220;Currently the total number of processes &#8221;<br \/>\necho &#8221; running on this machine is c&#8221;<br \/>\nps -ef | tail +2 | wc -l # wc -l gives number of lines<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>bash-3.2$ .\/echoscript.sh<\/p>\n<p>The name of the machine is solaris23<\/p>\n<p>The machine platform type is i86pc<\/p>\n<p>Specific processor information for this machine is:<br \/>\n.\/echoscript.sh: psrinfo: not found<\/p>\n<p>Currently the total number of processes<br \/>\nrunning on this machine is 64 From: http:\/\/sitestree.com\/?p=12223<br \/> Categories:Root<br \/>Tags:<br \/> Post Data:2018-05-03 23:45:10<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>bash-3.2$ cat echoscript.sh #!\/bin\/sh # This script will print useful information about the current machine. # It will print the machine name, model type, specific processor # information, and the current number of processes running. echo echo &#8220;The name of the machine is c&#8221; uname -n # uname -n gives the hostname echo echo &#8220;The &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=24594\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-24594","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":65722,"url":"http:\/\/bangla.sitestree.com\/?p=65722","url_meta":{"origin":24594,"position":0},"title":"Topic 1: Basic Date Displaying Shell Script #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"bash-3.2$ cat echoscript1.sh #!\/bin\/sh #clear echo \"SCRIPT BEGINS\" echo \"Hello $LOGNAME\" echo echo \"Todays date is: c\" date '+%m\/%d\/%y' echo \"and the current time is: c\" date '+%H:%M:%S%n' echo \"Now a list of the processes in the current shell\" ps echo \"SCRIPT FINISHED!!\" bash-3.2$ .\/echoscript1.sh SCRIPT BEGINS Hello shell Todays\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67594,"url":"http:\/\/bangla.sitestree.com\/?p=67594","url_meta":{"origin":24594,"position":1},"title":"Network Interface, Network Clients related Linux\/Redhat\/CentOS commands #DevOps #RHCSA","author":"Author-Check- Article-or-Video","date":"July 25, 2021","format":false,"excerpt":"echo \"Dec 24th, 2017\" 532 echo \"Basic Networking in Linux\" 533 hostname 534 uname -a 535 uname -n 536 cat \/etc\/hostname 537 nmcli general hostname 538 changing hostname temporarily 539 hostname server10.example.com 540 for permanent change 541 hostnamectl set-hostname server100.example.com 542 or change \/etc\/hostname file 543 vim \/etc\/hostname 544 restart\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65728,"url":"http:\/\/bangla.sitestree.com\/?p=65728","url_meta":{"origin":24594,"position":2},"title":"Topic 2: Example: Comments in Shell Scripts #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"bash-3.2$ cat scriptwithcomments.sh #!\/bin\/sh # This script clears the window, greets the user, # and displays the current date and time. #clear # Clear the window echo \"SCRIPT BEGINS\" echo \"Hello $LOGNAME!\" # Greet the user echo echo \"Todays date and time: c\" date # Display current date and time\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65726,"url":"http:\/\/bangla.sitestree.com\/?p=65726","url_meta":{"origin":24594,"position":3},"title":"Topic 2: Logname, Date Time, Shell Script #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"bash-3.2$ cat firstscript.sh #!\/bin\/sh #clear echo \"SCRIPT BEGINS\" echo \"Hello $LOGNAME!\" echo echo \"Today's date and time: c\" date echo mynum=21 myday=\"Monday\" echo \"The value of mynum is $mynum\" echo \"The value of myday is $myday\" echo echo \"SCRIPT FINISHED!!\" echo bash-3.2$ .\/firstscript.sh SCRIPT BEGINS Hello shell! Today's date and\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65685,"url":"http:\/\/bangla.sitestree.com\/?p=65685","url_meta":{"origin":24594,"position":4},"title":"A Basic Shell Program #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 11, 2021","format":false,"excerpt":"#!\/bin\/sh #if enabled - will spit out the script to the screen #set -v #clear the screen clear echo \"SCRIPT BEGINS\" #shows current login name echo \"Hello $LOGNAME\" #shows current date in the same line echo \"Todays date is: c\" date +%m\/%d\/%y #shows current time in the same line echo\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65730,"url":"http:\/\/bangla.sitestree.com\/?p=65730","url_meta":{"origin":24594,"position":5},"title":"Topic 2: Example: Debug a Script #Linux\/Unix: Shell Programming &#8211; 001","author":"Author-Check- Article-or-Video","date":"July 12, 2021","format":false,"excerpt":"Example debugging a Script \u00a0 bash-3.2$ sh -x scriptwithcomments.sh + echo SCRIPT BEGINS SCRIPT BEGINS + echo Hello shell! Hello shell! + echo + echo Todays date and time: c Todays date and time: + date Fri Apr 27 09:16:29 EDT 2018 + echo mynum=21 myday=Monday + echo The value\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/24594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24594"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/24594\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24594"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}