{"id":137929,"date":"2021-12-03T15:13:57","date_gmt":"2021-12-03T20:13:57","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=137929"},"modified":"2022-06-07T09:25:29","modified_gmt":"2022-06-07T13:25:29","slug":"linux-commands","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/scc-environment\/linux-commands\/","title":{"rendered":"Linux Commands"},"content":{"rendered":"<p>This page gives an introduction to the basics of <b>Linux Commands<\/b>.  A more <a href=\"https:\/\/ss64.com\/bash\/\">comprehensive guide to the many available Linux commands<\/a> is available. <\/p>\n<p>We also have three guides\/cheat sheets that may be useful to you while using the system and we recommend you bookmarking or printing out and keeping available: <a href=\"http:\/\/scv.bu.edu\/documents\/SCC_GettingStarted.pdf\">Getting Started Reference Sheet (PDF)<\/a>, <a href=\"http:\/\/scv.bu.edu\/documents\/SCC_CheatSheet.pdf\">Shared Computing Cluster Usage Cheat Sheet (PDF)<\/a>, and <a href=\"http:\/\/scv.bu.edu\/documents\/Linux_SCC_CheatSheet.pdf\">Linux Guide for SCC Users (PDF)<\/a><\/p>\n<p>In addition to this page, we also have a page on <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/using-file-system\/navigation\/\">Navigating the Linux File System<\/a> with information on common Linux commands for working with files.<\/p>\n<h2>Linux Commands Overview<a name=\"LOVERVIEW\"><\/a><\/h2>\n<p>Once logged into the Shared Computing Cluster (SCC), you will be in a terminal window. You will see a <strong>command prompt<\/strong> which allows you to type Linux commands. The program you interact with is called the Linux &#8220;<strong>shell<\/strong>&#8220;.  Using the shell, you will communicate with the operating system and filesystem using &#8220;<strong>commands<\/strong>&#8220;.  <\/p>\n<h2>Command Prompt<a name=\"LPROMPT\"><\/a><\/h2>\n<p>After <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/\">connecting<\/a> to the Shared Computing Cluster and opening a shell (command window), you will be presented with a <span class=\"command\">command prompt<\/span>. This can look different depending on the <b>shell<\/b>. The default shell is called &#8220;<b>bash<\/b>&#8221; and for most users it will look as follows.<\/p>\n<pre class=\"code-block\"><code><span class=\"prompt\">[<span class=\"placeholder\">username<\/span>@scc1 ~]$<\/span><\/code><\/pre>\n<p>Regardless of your shell, your interaction with the cluster will be nearly identical. This prompt lets you type in Linux commands to the system to create directories, list files, and do more complex things like run applications. Make sure to hit the \u201cEnter\u201d key after typing in any Linux command.<\/p>\n<p>If your <strong>command prompt<\/strong> looks significantly different than normal, this will usually mean that you are inside some specific application and the commands available will be specific to that application, not the standard Linux commands listed on this page.<\/p>\n<h2>Commands, Arguments and Options<a name=\"LARGS\"><\/a><\/h2>\n<ul>\n<li><b>Commands<\/b> are issued to the system by typing in the terminal; some are straightforward and are entered as is.\n<pre class=\"code-block\"><code><span class=\"comment\"># <b>whoami<\/b> simply returns the username of the current user.<\/span>\r\n<span class=\"prompt\">[<span class=\"placeholder\">username<\/span>@scc1 ~]$<\/span> <span class=\"command\">whoami<\/span>\r\n<span class=\"placeholder\">username<\/span>\r\n<\/code><\/pre>\n<\/li>\n<li><b>Arguments<\/b> are given to some commands to specify what the command should do something to or with. Often arguments are filenames (that the command will work with) or text (that the command will use).\n<pre class=\"code-block\"><code><span class=\"comment\"># <b>echo<\/b> takes an \"argument\" and returns it to the screen (stdout).<\/span>\r\n<span class=\"prompt\">[<span class=\"placeholder\">username<\/span>@scc1 ~]$<\/span> <span class=\"command\">echo<\/span> \"Hello\"\r\n<span class=\"output\">Hello<\/span>\r\n<\/code><\/pre>\n<\/li>\n<li><b>Options<\/b> instruct a command to perform a task in different ways. To use these expanded functions, you use the same command and specify different &#8220;options.&#8221; Options are usually preceeded by a dash (-) or double-dash (&#8211;) if a full word is used.\n<pre class=\"code-block\"><code><span class=\"comment\"># <b>hostname<\/b> returns the name of the system you are currently using. The <b>-f<\/b> \"option\" returns the full name (including bu.edu).<\/span>\r\n<span class=\"prompt\">[<span class=\"placeholder\">username<\/span>@scc1 ~]$<\/span> <span class=\"command\">hostname -f<\/span>\r\n<span class=\"output\">scc1.bu.edu<\/span>\r\n<\/code><\/pre>\n<\/li>\n<li>Most commands have a manual page that can be accessed using the &#8220;<b>man<\/b>&#8221; command.\n<pre class=\"code-block\"><code><span class=\"prompt\">[<span class=\"placeholder\">username<\/span>@scc1 ~]$<\/span> <span class=\"command\">man hostname<\/span>\r\n<\/code><\/pre>\n<div class=\"highlight-yellow\">Note: &#8220;<b>q<\/b>&#8221; quits the manual pager.<\/div>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This page gives an introduction to the basics of Linux Commands. A more comprehensive guide to the many available Linux commands is available. We also have three guides\/cheat sheets that may be useful to you while using the system and we recommend you bookmarking or printing out and keeping available: Getting Started Reference Sheet (PDF),&#8230;<\/p>\n","protected":false},"author":1692,"featured_media":0,"parent":137925,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137929"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1692"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=137929"}],"version-history":[{"count":28,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137929\/revisions"}],"predecessor-version":[{"id":140660,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137929\/revisions\/140660"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137925"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=137929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}