{"id":2854,"date":"2024-01-30T17:05:36","date_gmt":"2024-01-30T17:05:36","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=2854"},"modified":"2024-01-30T17:05:36","modified_gmt":"2024-01-30T17:05:36","slug":"make-script-executable-from-terminal","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/","title":{"rendered":"How to Make a &#8220;sh&#8221; Script Executable to Run From a Terminal?"},"content":{"rendered":"<div class=\"cl-preview-section\">\n<p id=\"i.-introduction\"><span style=\"font-size: 16px;\">In the realm of computing, <\/span><strong style=\"font-size: 16px;\">shell scripts<\/strong><span style=\"font-size: 16px;\">\u00a0are pivotal tools. These scripts, written in a shell programming language, hold the key to automating tasks within a Unix-like operating system. Their significance lies in their ability to streamline processes, offering efficiency and speed. In this guide, you\u2019ll delve into the crucial process of making these scripts not just writable but executable from the terminal. Uncover the power of seamless automation by understanding the importance of executing shell scripts.<\/span><\/p>\n\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"ii.-understanding-shell-scripts\"><span id=\"making-shell-scripts-executable-to-run-from-the-terminal\">Making Shell Scripts Executable to Run From the Terminal<\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Shell scripts, at their core, are sets of commands that the operating system executes. In the Unix-like environment, these scripts play a pivotal role in automating various tasks. The \u2018.sh\u2019 file extension designates them as shell scripts, distinguishing them from other file types. Essentially, these scripts are the architects of efficiency, orchestrating commands to perform tasks swiftly and effectively. As we explore how to make them executable, you\u2019ll gain a deeper understanding of their role in enhancing productivity within the Unix environment.<\/p>\n<p>Let&#8217;s go over each step of creating a shell script and running it from the terminal:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"iii.-creating-a-simple-shell-script\"><span id=\"step-1-creating-a-simple-shell-script\">Step 1: Creating a Simple Shell Script<\/span><\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Creating a shell script involves utilizing a text editor like Nano or Vim. These editors enable you to write a sequence of commands to perform a specific task. Start by opening the desired editor and crafting a basic script. For instance, a script to list files in a directory might look like this:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token shebang important\">#!\/bin\/bash<\/span>\r\n<span class=\"token function\">ls<\/span>\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Save this script with a \u2018.sh\u2019 extension, such as \u2018list_files.sh\u2019. This step marks the initiation of your journey into shell scripting.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"iv.-permissions-and-executability\"><span id=\"step-2-permissions-and-executability\">Step 2: Permissions and Executability<\/span><\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Understanding file permissions is crucial for making a shell script executable. In Linux\/Unix, the execute permission (\u2018x\u2019) determines whether a file can be run as a program. By default, newly created scripts may lack this permission. Utilize the\u00a0<code>chmod<\/code>\u00a0command to add execute permission:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">chmod<\/span> +x script.sh\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command grants the script execution rights. After this, your script is not merely a text file; it\u2019s a executable program ready to run from the terminal.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"v.-checking-current-permissions\"><span id=\"step-3-checking-current-permissions\">Step 3: Checking Current Permissions<\/span><\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Before proceeding, it\u2019s beneficial to confirm the current permissions of your shell script. Use the\u00a0<code>ls -l<\/code>\u00a0command to list detailed file information. In the output, you\u2019ll observe a series of letters indicating permissions. Ensure that \u2018x\u2019 (execute) permission is present for your script. If it\u2019s missing, the script won\u2019t be executable. This step is crucial for verifying that your script has the necessary permissions for terminal execution.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"vi.-making-a-script-executable\"><span id=\"step-4-making-a-script-executable\">Step 4: Making a Script Executable<\/span><\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>The process of making a shell script executable involves the\u00a0<code>chmod<\/code>\u00a0command, which stands for \u201cchange mode.\u201d To add execute permission, use the following syntax:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">chmod<\/span> +x script.sh\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command modifies the file mode bits to include execute permission. The \u2018+\u2019 signifies adding, and \u2018x\u2019 denotes execute. After running this command, your shell script is ready to be executed directly from the terminal. This step is pivotal for transforming your script into an executable program, ensuring it can perform the intended tasks when called upon.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"vii.-verifying-executability\"><span id=\"step-5-verifying-executability\">Step 5: Verifying Executability<\/span><\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>After making your shell script executable, it\u2019s essential to verify the changes. Once again, use the\u00a0<code>ls -l<\/code>\u00a0command to list detailed file information. Confirm that the \u2018x\u2019 (execute) permission is now present for your script. The output should display the updated permissions, indicating that your script is ready for execution. This verification step ensures that the necessary permissions have been successfully added, paving the way for seamless execution from the terminal.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"viii.-running-the-shell-script\"><span id=\"step-6-running-the-shell-script\">Step 6: Running the Shell Script<\/span><\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>With the necessary permissions in place, running your shell script is a straightforward process. Navigate to the directory where your script is located using the\u00a0<code>cd<\/code>\u00a0command. Then, execute the script using the following command:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\">.\/script.sh\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Replace \u2018<a href=\"http:\/\/script.sh\/\">script.sh<\/a>\u2019 with the name of your shell script. The \u2018.\/\u2019 denotes the current directory, informing the terminal to look for the script in the present location. Upon hitting Enter, your shell script will execute, carrying out the tasks defined within the script. This step marks the culmination of the process, showcasing the practical execution of your shell script in a terminal environment.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"ix.-troubleshooting-execution-issues\"><span id=\"troubleshooting-execution-issues-with-shell-scripts\">Troubleshooting Execution Issues With Shell Scripts<\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>While running a shell script is usually straightforward, you might encounter occasional issues. If your script fails to execute, consider these troubleshooting tips:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<ol>\n<li><strong>Check File Path:<\/strong>\u00a0Ensure you\u2019re in the correct directory or provide the full path to the script.<\/li>\n<li><strong>Permissions:<\/strong>\u00a0Reconfirm that execute permissions are correctly set using\u00a0<code>chmod +x<\/code>.<\/li>\n<li><strong>Shebang Line:<\/strong>\u00a0Verify the shebang line (<code>#!\/bin\/bash<\/code>) at the script\u2019s beginning, ensuring it points to the correct shell.<\/li>\n<li><strong>Encoding:<\/strong>\u00a0Ensure your script is saved with the correct encoding, typically UTF-8.<\/li>\n<li><strong>Syntax Errors:<\/strong>\u00a0Examine your script for syntax errors by running\u00a0<code>bash -n script.sh<\/code>.<\/li>\n<\/ol>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>By addressing these common issues, you can troubleshoot and resolve execution problems, ensuring your shell script runs smoothly.<\/p>\n<h2 id=\"dracula-vps-hosting-service\">Dracula VPS Hosting Service<\/h2>\n<p><a href=\"http:\/\/draculaservers.com\"><span style=\"font-weight: 400;\">Dracula Servers<\/span><\/a><span style=\"font-weight: 400;\"> offers high-performance server hosting at entry-level prices. The plans include Linux VPS, Sneaker Servers, Dedicated Servers &amp; turnkey solutions. If you&#8217;re looking for quality self-managed servers with high amounts of RAM and storage, look no further.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Check the plans for yourself by clicking <\/span><a href=\"https:\/\/draculaservers.com\/#pick-plan\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Here<\/span><\/a><span style=\"font-weight: 400;\">!<\/span><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"x.-best-practices\"><span id=\"best-practices-for-executable-scripts\">Best Practices For Executable Scripts<\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>As you delve deeper into shell scripting, adopting best practices becomes paramount:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<ol>\n<li><strong>Organize Your Scripts:<\/strong>\u00a0Keep scripts organized in a dedicated directory for easy access.<\/li>\n<li><strong>Add Comments:<\/strong>\u00a0Document your scripts with comments to explain functionality and usage.<\/li>\n<li><strong>Version Control:<\/strong>\u00a0Consider using version control systems like Git to track changes.<\/li>\n<li><strong>Backup Scripts:<\/strong>\u00a0Regularly backup important scripts to prevent data loss.<\/li>\n<li><strong>Testing:<\/strong>\u00a0Before deploying, test scripts in a safe environment to catch potential issues.<\/li>\n<\/ol>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>By adhering to these best practices, you enhance the reliability, maintainability, and efficiency of your shell scripts. This section provides guidance on troubleshooting common execution problems and adopting practices for effective script management.<\/p>\n<div class=\"cl-preview-section\">\n<h2 id=\"xii.-additional-resources\"><span id=\"additional-resources-related-to-executable-bash-scripts\">Additional Resources Related To Executable Bash Scripts<\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>For further exploration and enhancing your shell scripting skills, consider the following resources:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<ol>\n<li><a href=\"https:\/\/www.gnu.org\/software\/bash\/manual\/bash.html\">Bash Reference Manual<\/a>: The official manual for the Bash shell, providing in-depth information on its features and usage.<\/li>\n<li><a href=\"https:\/\/tldp.org\/\">Linux Documentation Project<\/a>: A comprehensive resource offering guides, how-tos, and FAQs related to Linux and Unix.<\/li>\n<li><a href=\"https:\/\/www.shellcheck.net\/\">ShellCheck<\/a>: An online tool to check your shell scripts for common issues and improvements.<\/li>\n<li><a href=\"https:\/\/github.com\/\">GitHub<\/a>: Explore repositories containing various shell scripts to learn from real-world examples and projects.<\/li>\n<\/ol>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>As you continue your journey in shell scripting, these resources will serve as valuable references and inspiration for expanding your knowledge and capabilities.<\/p>\n<\/div>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"xi.-conclusion\"><span id=\"wrap-up\">Wrap Up<\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>In conclusion, mastering the process of making a shell script executable and running it from the terminal is foundational for any Linux or Unix user. This guide has walked you through the crucial steps, from creating a simple script and understanding permissions to troubleshooting issues and implementing best practices. Armed with this knowledge, you\u2019re well-equipped to harness the power of shell scripting for automating tasks and boosting your productivity in a Unix-like environment. As you continue your journey in shell scripting, remember that practice and exploration are key to becoming proficient in this powerful skill.<\/p>\n<p>Check out More Linux Tutorials <a href=\"https:\/\/draculaservers.com\/tutorials\/\" target=\"_blank\" rel=\"noopener\">Here!<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the realm of computing, shell scripts\u00a0are pivotal tools. These scripts, written in a shell programming language, hold the key to automating tasks within a Unix-like operating system. Their significance lies in their ability to streamline processes, offering efficiency and speed. In this guide, you\u2019ll delve into the crucial process of making these scripts not [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2857,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61,172],"tags":[205,208,206,207],"class_list":["post-2854","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands","category-linux-tutorials","tag-bash-scripting","tag-linux-shell-guides","tag-linux-shell-scripting","tag-linux-shell-tutorials"],"blocksy_meta":[],"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png",1280,720,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14-300x169.png",300,169,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14-768x432.png",768,432,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14-1024x576.png",1024,576,true],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png",1280,720,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png",1280,720,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>In the realm of computing, shell scripts\u00a0are pivotal tools. These scripts, written in a shell programming language, hold the key to automating tasks within a Unix-like operating system. Their significance lies in their ability to streamline processes, offering efficiency and speed. In this guide, you\u2019ll delve into the crucial process of making these scripts not just writable but executable from the terminal. Uncover the power of seamless automation by understanding the importance of executing shell scripts. Making Shell Scripts Executable to Run From the Terminal Shell scripts, at their core, are sets of commands that the operating system executes. In&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/linux-commands\/\" rel=\"category tag\">Linux Commands<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/linux-tutorials\/\" rel=\"category tag\">Linux Tutorials<\/a>","author_info_v2":{"name":"Abdul Mannan","url":"https:\/\/draculaservers.com\/tutorials\/author\/abdul-mannan-tbgmail-com\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Make a &quot;sh&quot; Script Executable to Run From a Terminal? - Dracula Servers Tutorials<\/title>\n<meta name=\"description\" content=\"Make script is executable by using the chmod +x command to add the necessary execute permission and then verify and run it with .\/script.sh.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Make a &quot;sh&quot; Script Executable to Run From a Terminal? - Dracula Servers Tutorials\" \/>\n<meta property=\"og:description\" content=\"Make script is executable by using the chmod +x command to add the necessary execute permission and then verify and run it with .\/script.sh.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-30T17:05:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abdul Mannan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abdul Mannan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/\"},\"author\":{\"name\":\"Abdul Mannan\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\"},\"headline\":\"How to Make a &#8220;sh&#8221; Script Executable to Run From a Terminal?\",\"datePublished\":\"2024-01-30T17:05:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/\"},\"wordCount\":1183,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/What-14.png\",\"keywords\":[\"Bash Scripting\",\"Linux Shell Guides\",\"Linux Shell Scripting\",\"Linux Shell Tutorials\"],\"articleSection\":[\"Linux Commands\",\"Linux Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/\",\"name\":\"How to Make a \\\"sh\\\" Script Executable to Run From a Terminal? - Dracula Servers Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/What-14.png\",\"datePublished\":\"2024-01-30T17:05:36+00:00\",\"description\":\"Make script is executable by using the chmod +x command to add the necessary execute permission and then verify and run it with .\\\/script.sh.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/What-14.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/What-14.png\",\"width\":1280,\"height\":720,\"caption\":\"How to Make a \\\"sh\\\" Script Executable to Run From a Terminal?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/make-script-executable-from-terminal\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Make a &#8220;sh&#8221; Script Executable to Run From a Terminal?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\",\"name\":\"Abdul Mannan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"caption\":\"Abdul Mannan\"},\"description\":\"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Make a \"sh\" Script Executable to Run From a Terminal? - Dracula Servers Tutorials","description":"Make script is executable by using the chmod +x command to add the necessary execute permission and then verify and run it with .\/script.sh.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/","og_locale":"en_US","og_type":"article","og_title":"How to Make a \"sh\" Script Executable to Run From a Terminal? - Dracula Servers Tutorials","og_description":"Make script is executable by using the chmod +x command to add the necessary execute permission and then verify and run it with .\/script.sh.","og_url":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2024-01-30T17:05:36+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png","type":"image\/png"}],"author":"Abdul Mannan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abdul Mannan","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/"},"author":{"name":"Abdul Mannan","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6"},"headline":"How to Make a &#8220;sh&#8221; Script Executable to Run From a Terminal?","datePublished":"2024-01-30T17:05:36+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/"},"wordCount":1183,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png","keywords":["Bash Scripting","Linux Shell Guides","Linux Shell Scripting","Linux Shell Tutorials"],"articleSection":["Linux Commands","Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/","url":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/","name":"How to Make a \"sh\" Script Executable to Run From a Terminal? - Dracula Servers Tutorials","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png","datePublished":"2024-01-30T17:05:36+00:00","description":"Make script is executable by using the chmod +x command to add the necessary execute permission and then verify and run it with .\/script.sh.","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/01\/What-14.png","width":1280,"height":720,"caption":"How to Make a \"sh\" Script Executable to Run From a Terminal?"},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/make-script-executable-from-terminal\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to Make a &#8220;sh&#8221; Script Executable to Run From a Terminal?"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6","name":"Abdul Mannan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","caption":"Abdul Mannan"},"description":"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot."}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=2854"}],"version-history":[{"count":2,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2854\/revisions"}],"predecessor-version":[{"id":2856,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2854\/revisions\/2856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/2857"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=2854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=2854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=2854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}