{"componentChunkName":"component---node-modules-gatsby-theme-blog-core-src-templates-post-query-js","path":"/blog/essential-bash/","result":{"data":{"site":{"siteMetadata":{"title":"Geekynut","social":[{"name":"twitter","url":"https://twitter.com/geekynut"},{"name":"github","url":"https://github.com/geekynut"}]}},"blogPost":{"__typename":"MdxBlogPost","id":"26d15029-ea9f-5b5b-b27b-2b259a1e31e5","excerpt":"Bash small pills Here is a list of bash commands that may help you to familiarize with the bash command line. I kept the list minimalistic…","body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Bash Startpack\",\n  \"path\": \"/blog/essential-bash\",\n  \"tags\": [\"linux\", \"command line\", \"bash\", \"terminal\"],\n  \"date\": \"2020-04-15T00:00:00.000Z\",\n  \"topic\": \"Linux\",\n  \"level\": \"beginner\",\n  \"description\": \"A list of bash commands that may help you to familiarize with the bash command line. A startpack for anyone beginning to use the command line.\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h2\", {\n    \"id\": \"bash-small-pills\"\n  }, \"Bash small pills\"), mdx(\"p\", null, \"Here is a list of bash commands that may help you to familiarize with the bash command line.\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"I kept the list minimalistic so that can be used as reference.\"), mdx(\"hr\", null), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \" To take in account: \"), \" unix filesystem is case sensitive and you will encounter an error if you don\\u2019t abide this rule \")), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"pwd-print-working-directory\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"pwd\"), \" print working directory\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"pwd\"), \" stands for print working directory and as the name suggests it shows the directory we are operating from. \"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"   $ pwd\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/03446d90568480de14d46d835a2a0d79/pwd.gif\",\n    \"alt\": \"pwd command line bash\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"change-directory\"\n  }, \"Change directory\"), mdx(\"p\", null, \"cd stands for change directory and has the same functionality of cd in dos system. After the command you need to specify the name of the directory you need to move in.\\nIn ZSH bash if you use the tab key right after the cd command  not only will auto-complete help you to spell the directory but you will be shown the available folders where you can navigate to. \"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"    $ cd name-directory\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/aac6c6c95cad1ece0b0f4eea321c1def/cd.gif\",\n    \"alt\": \"cd command line bash\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"ls-list-files\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"ls\"), \" list files\"), mdx(\"p\", null, \"ls is the equivalent of the dir command in dos command line, it lists the files and subdirectories present in the working directory. \"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"    $ ls\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/7dace98da484f4d013b6446360a6e5d9/ls.gif\",\n    \"alt\": \"ls command line bash\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"ls--sail\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"ls -sail\")), mdx(\"p\", null, \"you can add arguments to ls so that the listing could be more specialized, to know more about what ls can do you can use the command \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"ls \\u2014help\"), \" or \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"man ls\"), \" to read the documentation.\\n\", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"ls -sail\"), \" is an easy mnemonic combination of arguments that gives you a fairly complete output\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"    $ ls -sail\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/d6278eb08e68b647b4a8ebab0ef25e87/ls-sail.gif\",\n    \"alt\": \"cd gif\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"clear\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"clear\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"clear\"), \" is a useful command that cleans the bash from the previous outputs. You\\u2019ll find yourself using it a lot!\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"    $ ls clear\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/0e0d8827394bad6ee913ba449ef92c50/clear.gif\",\n    \"alt\": \"cd gif\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"mkdir-create-directory\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"mkdir\"), \" create directory\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"mkdir\"), \" stands for make directory and as the name suggests it creates one or more folders. To use \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"mkdir\"), \" you just need to add the name of the directory you wish to create after the command, if you want to create more than one folder you can list them divided from a white-space\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"   $ mkdir name-directory\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/711336d77e9028753b9d2e2d59c9e577/mkdir.gif\",\n    \"alt\": \"mkdir command line bash\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"rmdir-remove-directory\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"rmdir\"), \" remove directory\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"rmdir\"), \" stands for remove directory and as the name suggests it deletes one or more folders. To use \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"rmdir\"), \" you just need to add the name of the directory you wish to delete after the command, for more than one folder to delete you can list them divided from a white-space.\\n\", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \" You cannot remove a directory using \", mdx(\"em\", {\n    parentName: \"strong\"\n  }, \"rmdir\"), \" \"), \" if it contains one or more files or directories. \"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"   $ rmdir name-directory\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/74a9abea507c5005328c9a71e683911a/rmdir.gif\",\n    \"alt\": \"rmdir command line bash\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"rm-remove-files\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"rm\"), \" remove file/s\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"rm\"), \" stands for remove file and as the name suggests it deletes one or more files. To use \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"rm\"), \" you just need to add the name of the file you wish to delete right after the command, if you wish to delete more than one file you can list them divided from a white-space.\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"   $ rm file1\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/9f8419b8f53ee8771eecc562edda493d/rm.gif\",\n    \"alt\": \"rm command line bash\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"touch-touchescreates-files\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"touch\"), \" touches/creates files\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"touch\"), \" is usually used to create one or more files. It\\u2019s useful when you want to create a bunch of empty files with a single command. If the files exists \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"touch\"), \" does only touch the files, this may not make sense but it could be useful if you need to test a program that starts when a file is saved.\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"   $ touch file1\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/bf599a80d0a2e7f3d548d518bbd4dcf8/touch.gif\",\n    \"alt\": \"touch command line bash\"\n  }))), mdx(\"hr\", null), mdx(\"h3\", {\n    \"id\": \"cat\"\n  }, mdx(\"strong\", {\n    parentName: \"h3\"\n  }, \"cat\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"cat\"), \" is a useful command to read files sequentially. In case you wish to read only the head or the tail of a big file you can exchange \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"cat\"), \" with \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"head\"), \" or \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"tail.\"), \"  \"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"   $ cat file\\n\")), mdx(\"p\", null, mdx(\"img\", _extends({\n    parentName: \"p\"\n  }, {\n    \"src\": \"/6ce7a2d05b5bed7c1c2e9b365426cc77/cat.gif\",\n    \"alt\": \"cat command line bash\"\n  }))));\n}\n;\nMDXContent.isMDXComponent = true;","slug":"/blog/essential-bash/","title":"Bash Startpack","tags":["linux","command line","bash","terminal"],"keywords":[],"date":"April 15, 2020"},"previous":null,"next":{"__typename":"MdxBlogPost","id":"0be18779-bf5d-53ef-82d1-d3d2424c6ca0","excerpt":"Javascript Reduce array methods Map, filter and reduce are among the first methods that wow you when learning arrays methods. Reduce has a…","slug":"/blog/reducejs/","title":"Reduce JS","date":"May 07, 2020"}},"pageContext":{"id":"26d15029-ea9f-5b5b-b27b-2b259a1e31e5","nextId":"0be18779-bf5d-53ef-82d1-d3d2424c6ca0"}}}