{"id":119150,"date":"2018-04-03T10:56:44","date_gmt":"2018-04-03T10:56:44","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=119150"},"modified":"2018-04-30T11:25:54","modified_gmt":"2018-04-30T11:25:54","slug":"how-to-customize-magento-2-commands","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/","title":{"rendered":"How to customize Magento 2 commands?"},"content":{"rendered":"<p>Whenever we update something in Magento 2 we need to run different commands which are quite lengthy and while writing them we may have some typo errors as well.\u00a0 To short\/customize Magento 2 commands you can alias all your required commands. But the drawback is, it saves these aliases in the current terminal session only. To overcome this drawback we have a solution\u00a0for it.<\/p>\n<p>In your home directory, you&#8217;ll have ~\/.bashrc and .bash_aliases hidden files. To make permanent changes you can write your aliases separately in ~\/.bash_aliases file and it will be read automatically whenever a new session starts. For this, your ~\/.bashrc file should have the following-<\/p>\n<p><strong>if [ -f ~\/.bash_aliases ]; then<\/strong><br \/>\n<strong>. ~\/.bash_aliases<\/strong><br \/>\n<strong>fi<\/strong><\/p>\n<p>~\/.bashrc file will already have the above-mentioned code. It means if you have a file ~\/.bash_aliases file then it will be sourced and all the aliases written in it will be applied in the current terminal session. If you don&#8217;t have ~\/.bash_aliases file you can create it manually.<\/p>\n<p>Here, you can find the list of some Magento commands which I have aliased and run the customized command to get the desired output.<\/p>\n<p><strong>Example-<\/strong> I have used <strong>alias cf=&#8221;php bin\/magento cache:flush&#8221;<\/strong>\u00a0so whenever I&#8217;ll run <strong>cf\u00a0<\/strong>in the Magento\u00a0root directory complete cache flush command will run.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-119152\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png\" alt=\"\" width=\"532\" height=\"146\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png 532w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1-250x69.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1-300x82.png 300w\" sizes=\"(max-width: 532px) 100vw, 532px\" loading=\"lazy\" \/><\/p>\n<p><a href=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias2.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-119153\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias2.png\" alt=\"\" width=\"511\" height=\"267\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias2.png 511w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias2-250x131.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias2-300x157.png 300w\" sizes=\"(max-width: 511px) 100vw, 511px\" loading=\"lazy\" \/><\/a><\/p>\n<p>If you have any doubt then please leave us a comment here.<\/p>\n<p>Thanks! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever we update something in Magento 2 we need to run different commands which are quite lengthy and while writing them we may have some typo errors as well.\u00a0 To short\/customize Magento 2 commands you can alias all your required commands. But the drawback is, it saves these aliases in the current terminal session only. <a href=\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":66,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[6458,6459,6462,6464,6461,353,2938,2460,2070,6463],"class_list":["post-119150","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-alias","tag-aliasing","tag-bash","tag-cli","tag-commands","tag-custom","tag-customize","tag-magento-2","tag-magento2","tag-short-commands"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to customize Magento 2 commands? - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to customize Magento 2 commands? - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Whenever we update something in Magento 2 we need to run different commands which are quite lengthy and while writing them we may have some typo errors as well.\u00a0 To short\/customize Magento 2 commands you can alias all your required commands. But the drawback is, it saves these aliases in the current terminal session only. [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-03T10:56:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-04-30T11:25:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png\" \/>\n<meta name=\"author\" content=\"Shruti Baranwal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shruti Baranwal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\"},\"author\":{\"name\":\"Shruti Baranwal\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/d90db6dde51254f8d7bda2539b81386e\"},\"headline\":\"How to customize Magento 2 commands?\",\"datePublished\":\"2018-04-03T10:56:44+00:00\",\"dateModified\":\"2018-04-30T11:25:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\"},\"wordCount\":237,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png\",\"keywords\":[\"alias\",\"aliasing\",\"bash\",\"cli\",\"commands\",\"Custom\",\"customize\",\"Magento 2\",\"Magento2\",\"short commands\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\",\"name\":\"How to customize Magento 2 commands? - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png\",\"datePublished\":\"2018-04-03T10:56:44+00:00\",\"dateModified\":\"2018-04-30T11:25:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png\",\"width\":\"532\",\"height\":\"146\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to customize Magento 2 commands?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/d90db6dde51254f8d7bda2539b81386e\",\"name\":\"Shruti Baranwal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2ecd6b094113b3e2f346229e04e90fcb6e242f28b3a1dbcb2f44fd9eefb93dbc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2ecd6b094113b3e2f346229e04e90fcb6e242f28b3a1dbcb2f44fd9eefb93dbc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Shruti Baranwal\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/shruti-baranwal890\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to customize Magento 2 commands? - Webkul Blog","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:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/","og_locale":"en_US","og_type":"article","og_title":"How to customize Magento 2 commands? - Webkul Blog","og_description":"Whenever we update something in Magento 2 we need to run different commands which are quite lengthy and while writing them we may have some typo errors as well.\u00a0 To short\/customize Magento 2 commands you can alias all your required commands. But the drawback is, it saves these aliases in the current terminal session only. [...]","og_url":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-04-03T10:56:44+00:00","article_modified_time":"2018-04-30T11:25:54+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png","type":"","width":"","height":""}],"author":"Shruti Baranwal","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Shruti Baranwal","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/"},"author":{"name":"Shruti Baranwal","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/d90db6dde51254f8d7bda2539b81386e"},"headline":"How to customize Magento 2 commands?","datePublished":"2018-04-03T10:56:44+00:00","dateModified":"2018-04-30T11:25:54+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/"},"wordCount":237,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png","keywords":["alias","aliasing","bash","cli","commands","Custom","customize","Magento 2","Magento2","short commands"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/","url":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/","name":"How to customize Magento 2 commands? - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png","datePublished":"2018-04-03T10:56:44+00:00","dateModified":"2018-04-30T11:25:54+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/04\/alias1.png","width":"532","height":"146"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-customize-magento-2-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to customize Magento 2 commands?"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/d90db6dde51254f8d7bda2539b81386e","name":"Shruti Baranwal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2ecd6b094113b3e2f346229e04e90fcb6e242f28b3a1dbcb2f44fd9eefb93dbc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ecd6b094113b3e2f346229e04e90fcb6e242f28b3a1dbcb2f44fd9eefb93dbc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Shruti Baranwal"},"url":"https:\/\/webkul.com\/blog\/author\/shruti-baranwal890\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/119150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/66"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=119150"}],"version-history":[{"count":17,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/119150\/revisions"}],"predecessor-version":[{"id":123331,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/119150\/revisions\/123331"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=119150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=119150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=119150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}