{"id":2932,"date":"2023-08-03T19:33:15","date_gmt":"2023-08-03T14:03:15","guid":{"rendered":"https:\/\/smarttech101.com\/?p=2932"},"modified":"2023-08-04T21:39:44","modified_gmt":"2023-08-04T16:09:44","slug":"understanding-brace-expansion-in-bash-generating-sequences","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/","title":{"rendered":"Understanding Brace Expansion in Bash: Generating Sequences"},"content":{"rendered":"\n<p>Brace expansion is a <strong>powerful<\/strong> feature in the Bash shell that allows users to <strong>generate sequences<\/strong> of text based on specified patterns. It provides a concise and efficient way to <strong>create multiple similar entries<\/strong> without the need for explicit enumeration. In this article, we will explore various use cases of brace expansion and learn how to leverage it effectively in different scenarios.<\/p>\n\n\n\n<p>This article is part of my series on bash. To have introductory knowledge of bash, have a look at this article &#8211; <a href=\"https:\/\/smarttech101.com\/bash-commands-in-linux-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">Useful Bash Commands in Linux with Examples<\/a>.<\/p>\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#1_Basic_Brace_Expansion\" title=\"1. Basic Brace Expansion\">1. Basic Brace Expansion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#2_Brace_Expansion_with_Leading_Zeros\" title=\"2. Brace Expansion with Leading Zeros\">2. Brace Expansion with Leading Zeros<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#3_Brace_Expansion_with_Letters\" title=\"3. Brace Expansion with Letters\">3. Brace Expansion with Letters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#4_Combining_Letters_and_Numbers_using_Brace_Expansion\" title=\"4. Combining Letters and Numbers using Brace Expansion\">4. Combining Letters and Numbers using Brace Expansion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#5_Nested_Brace_Expansion\" title=\"5. Nested Brace Expansion\">5. Nested Brace Expansion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#6_Incremental_Brace_Expansion\" title=\"6. Incremental Brace Expansion\">6. Incremental Brace Expansion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#7_Character_Range_Brace_Expansion\" title=\"7. Character Range Brace Expansion\">7. Character Range Brace Expansion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#8_Using_Brace_Expansion_in_a_Command\" title=\"8. Using Brace Expansion in a Command\">8. Using Brace Expansion in a Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#9_Using_Brace_Expansion_to_Create_Directories\" title=\"9. Using Brace Expansion to Create Directories\">9. Using Brace Expansion to Create Directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#10_Brace_Expansion_with_Variables\" title=\"10. Brace Expansion with Variables\">10. Brace Expansion with Variables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#11_Brace_Expansion_with_Special_Characters\" title=\"11. Brace Expansion with Special Characters\">11. Brace Expansion with Special Characters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#12_Using_command_output_with_brash_expansion\" title=\"12. Using command output with brash expansion\">12. Using command output with brash expansion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Basic_Brace_Expansion\"><\/span>1. Basic Brace Expansion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The simplest form of brace expansion generates a <strong>sequence of numbers<\/strong>. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {1..5}\n1 2 3 4 5<\/code><\/pre>\n\n\n\n<p>This command generates the <strong>sequence from 1 to 5<\/strong> and prints it on the screen. It&#8217;s useful when you want to <strong>create a range of values<\/strong> quickly and efficiently.<\/p>\n\n\n\n<p><a href=\"https:\/\/smarttech101.com\/echo-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">Using Echo Command in Linux\/Unix<\/a> is one of the most widely used commands used with bash. So please have a look at it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Brace_Expansion_with_Leading_Zeros\"><\/span>2. Brace Expansion with Leading Zeros<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion can handle <strong>leading zeros<\/strong> as well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {01..10}\n01 02 03 04 05 06 07 08 09 10<\/code><\/pre>\n\n\n\n<p>Here, the <strong>sequence goes from 01 to 10<\/strong>, preserving the leading zeros. This feature is often used when dealing with <strong>filenames<\/strong> that have a fixed pattern with leading zeros.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Brace_Expansion_with_Letters\"><\/span>3. Brace Expansion with Letters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion is not limited to <strong>numbers<\/strong>; it can also handle <strong>letters<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {a..e}\na b c d e<\/code><\/pre>\n\n\n\n<p>This command generates the <strong>sequence of lowercase letters<\/strong> from &#8216;a&#8217; to &#8216;e&#8217;. It can be handy when you need to <strong>create lists of letters<\/strong> or iterate over characters in a specific range.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Combining_Letters_and_Numbers_using_Brace_Expansion\"><\/span>4. Combining Letters and Numbers using Brace Expansion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can <strong>combine<\/strong> multiple brace expansions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {a..d}{1..3}\na1 a2 a3 b1 b2 b3 c1 c2 c3 d1 d2 d3<\/code><\/pre>\n\n\n\n<p>Here, it generates <strong>combinations of letters<\/strong> &#8216;a&#8217; to &#8216;d&#8217; with <strong>numbers<\/strong> &#8216;1&#8217; to &#8216;3&#8217;. This can be useful for generating <strong>combinations of variables<\/strong> or iterating over a 2D grid of values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Nested_Brace_Expansion\"><\/span>5. Nested Brace Expansion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion can be <strong>nested<\/strong> as well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {{1..3},{a..c}}\n1 2 3 a b c<\/code><\/pre>\n\n\n\n<p>This command generates a <strong>combined sequence<\/strong> of numbers from 1 to 3 and lowercase letters from &#8216;a&#8217; to &#8216;c&#8217;. Nesting brace expansions provides a way to create <strong>complex patterns<\/strong> easily.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Incremental_Brace_Expansion\"><\/span>6. Incremental Brace Expansion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can specify a <strong>step value<\/strong> to create incremental sequences:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {1..10..2}\n1 3 5 7 9<\/code><\/pre>\n\n\n\n<p>This generates the <strong>sequence from 1 to 10 with a step of 2<\/strong>. It&#8217;s particularly useful when you need to create sequences with a specific increment, such as <strong>odd or even numbers<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_Character_Range_Brace_Expansion\"><\/span>7. Character Range Brace Expansion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion can also work with <strong>character ranges<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {D..I}\nD E F G H I<\/code><\/pre>\n\n\n\n<p>It generates the <strong>uppercase alphabet<\/strong> from &#8216;D&#8217; to &#8216;I&#8217;. This feature is especially useful for creating patterns involving <strong>alphabetic characters<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_Using_Brace_Expansion_in_a_Command\"><\/span>8. Using Brace Expansion in a Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion can be very useful when combined with other <strong>shell commands<\/strong><sup>*<\/sup>. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ touch file_{1..5}.txt\n&#091;ajay@legion ~]$ ls\nfile_1.txt file_2.txt file_3.txt file_4.txt file_5.txt<\/code><\/pre>\n\n\n\n<p>In this example, we used brace expansion to <strong>create five files<\/strong> named <code>file_1.txt<\/code> to <code>file_5.txt<\/code> using the <code>touch<\/code> command. This technique can <strong>save time and effort<\/strong> when you need to create a batch of similar files quickly.<\/p>\n\n\n\n<p>Look at <a href=\"https:\/\/smarttech101.com\/touch-command-in-linux-unix-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">The touch Command in Linux\/Unix with Examples<\/a> to learn more about it.<\/p>\n\n\n\n<p><a href=\"https:\/\/smarttech101.com\/how-to-create-shell-scripts-in-linux-unix\/#variables_and_basic_commands_in_bash_shell_in_linux\" target=\"_blank\" rel=\"noreferrer noopener\">Learn more about shell scripting in this article<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9_Using_Brace_Expansion_to_Create_Directories\"><\/span>9. Using Brace Expansion to Create Directories<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion is also handy for <strong>creating multiple directories<\/strong> in one go:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ mkdir {apple,banana,orange}_fruit\n&#091;ajay@legion ~]$ ls\napple_fruit banana_fruit orange_fruit<\/code><\/pre>\n\n\n\n<p>This command creates three directories named <code>apple_fruit<\/code>, <code>banana_fruit<\/code>, and <code>orange_fruit<\/code>. It&#8217;s a convenient way to create <strong>multiple directories<\/strong> with a common pattern in their names.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"10_Brace_Expansion_with_Variables\"><\/span>10. Brace Expansion with Variables<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion can work with <strong>variables<\/strong> as well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ var1=hello\n&#091;ajay@legion ~]$ var2=world\n&#091;ajay@legion ~]$ echo \"{$var1,$var2}\"\n{hello,world}<\/code><\/pre>\n\n\n\n<p>Here, the brace expansion does not evaluate the variables but treats them as text. This can be useful when you want to use brace expansion as part of a larger command that involves variables.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"11_Brace_Expansion_with_Special_Characters\"><\/span>11. Brace Expansion with Special Characters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Brace expansion can handle <strong>special characters<\/strong> too:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ echo {.,_,-}\n. _ -<\/code><\/pre>\n\n\n\n<p>This command generates a sequence containing a <strong>dot<\/strong>, <strong>underscore<\/strong>, and <strong>hyphen<\/strong>. It&#8217;s helpful for quickly generating lists of special characters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"12_Using_command_output_with_brash_expansion\"><\/span>12. Using command output with brash expansion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can use <strong>command output<\/strong> within brace expansion:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;ajay@legion ~]$ date +%d\n03\n\n&#091;ajay@legion ~]$ echo {01..$(date +%d)}\n01 02 03<\/code><\/pre>\n\n\n\n<p>This example uses the date command to obtain the current day of the month, represented in two-digit format (which is <code>03<\/code>). It then utilizes brace expansion to create a sequence of numbers from 01 to the obtained day of the month hence <code>01 02 03<\/code> is the output.<\/p>\n\n\n\n<p>brace expansion combines the output of two brace expansions<\/p>\n\n\n\n<p>with <strong>numbers<\/strong> and <strong>letters<\/strong>. It can be used to generate <strong>complex combinations<\/strong> of strings.<\/p>\n\n\n\n<p>Brace expansion is a versatile feature that simplifies working with sequences and repetitive tasks in the Bash shell. It can significantly reduce the amount of <strong>manual effort<\/strong> needed to generate lists of data. Whether you need to create directories, files, or even complex combinations of characters, brace expansion is a <strong>powerful tool<\/strong> at your disposal.<\/p>\n\n\n\n<p>For more commands (with examples) used in association with Bash, check out these informative articles:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/smarttech101.com\/regular-expression-regex-and-regexp-in-linux-ft-grep\/\">Regular Expression (Regex) and Regexp in Linux<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/smarttech101.com\/copy-command-cp-in-linux-unix\/\">The Copy Command (cp) in Linux\/Unix<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/smarttech101.com\/grep-command-in-linux\/\">The grep command in Linux<\/a><\/li>\n<\/ol>\n\n\n\n<p>These articles cover a wide range of topics related to Linux, Bash, and other useful commands and tools. Whether you are a beginner or an experienced user, these resources will help you improve your Linux skills and make you more proficient in working with the command-line interface. And also don&#8217;t forget to check out <a href=\"https:\/\/www.gnu.org\/software\/bash\/manual\/html_node\/Brace-Expansion.html\" target=\"_blank\" rel=\"noreferrer noopener\">official GNU guide on brace expansion in bash<\/a>.<\/p>\n\n\n\n<p>Remember, mastering Bash and Linux can greatly improve your <strong>productivity<\/strong> and <strong>efficiency<\/strong> in various tasks. So keep exploring, experimenting, and learning new tricks to become a proficient Linux user. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Discover the power of Brace Expansion in Bash, a feature that enables you to generate sequences of text effortlessly. Learn how to create numeric ranges, combine letters and numbers, and even use variables in brace expansion. Boost your Linux productivity with this essential technique.<\/p>\n","protected":false},"author":2,"featured_media":2935,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[58],"tags":[18,35],"class_list":["post-2932","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash","tag-command-line-tools","tag-core-linux-utilities"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Understanding Brace Expansion in Bash: Generating Sequences | SmartTech101<\/title>\n<meta name=\"description\" content=\"Master Brace Expansion in Bash and unleash its power to generate sequences effortlessly. Boost your Linux productivity with this technique.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Brace Expansion in Bash: Generating Sequences | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"Master Brace Expansion in Bash and unleash its power to generate sequences effortlessly. Boost your Linux productivity with this technique.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-03T14:03:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-04T16:09:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.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=\"Ajay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ajay_yadav\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"Understanding Brace Expansion in Bash: Generating Sequences\",\"datePublished\":\"2023-08-03T14:03:15+00:00\",\"dateModified\":\"2023-08-04T16:09:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\"},\"wordCount\":870,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1\",\"keywords\":[\"Command Line Tools\",\"core linux utilities\"],\"articleSection\":[\"bash\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\",\"url\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\",\"name\":\"Understanding Brace Expansion in Bash: Generating Sequences | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1\",\"datePublished\":\"2023-08-03T14:03:15+00:00\",\"dateModified\":\"2023-08-04T16:09:44+00:00\",\"description\":\"Master Brace Expansion in Bash and unleash its power to generate sequences effortlessly. Boost your Linux productivity with this technique.\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720,\"caption\":\"Understanding Brace Expansion in Bash: Generating Sequences\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understanding Brace Expansion in Bash: Generating Sequences\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/smarttech101.com\/#website\",\"url\":\"https:\/\/smarttech101.com\/\",\"name\":\"SmartTech101\",\"description\":\"Do Everything in Linux\",\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/smarttech101.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\",\"name\":\"Ajay Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"width\":180,\"height\":60,\"caption\":\"Ajay Yadav\"},\"logo\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\",\"name\":\"Ajay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"caption\":\"Ajay\"},\"sameAs\":[\"https:\/\/x.com\/ajay_yadav\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Brace Expansion in Bash: Generating Sequences | SmartTech101","description":"Master Brace Expansion in Bash and unleash its power to generate sequences effortlessly. Boost your Linux productivity with this technique.","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:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Brace Expansion in Bash: Generating Sequences | SmartTech101","og_description":"Master Brace Expansion in Bash and unleash its power to generate sequences effortlessly. Boost your Linux productivity with this technique.","og_url":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/","og_site_name":"SmartTech101","article_published_time":"2023-08-03T14:03:15+00:00","article_modified_time":"2023-08-04T16:09:44+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png","type":"image\/png"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"Understanding Brace Expansion in Bash: Generating Sequences","datePublished":"2023-08-03T14:03:15+00:00","dateModified":"2023-08-04T16:09:44+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/"},"wordCount":870,"commentCount":1,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1","keywords":["Command Line Tools","core linux utilities"],"articleSection":["bash"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/","url":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/","name":"Understanding Brace Expansion in Bash: Generating Sequences | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1","datePublished":"2023-08-03T14:03:15+00:00","dateModified":"2023-08-04T16:09:44+00:00","description":"Master Brace Expansion in Bash and unleash its power to generate sequences effortlessly. Boost your Linux productivity with this technique.","breadcrumb":{"@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1","width":1280,"height":720,"caption":"Understanding Brace Expansion in Bash: Generating Sequences"},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/understanding-brace-expansion-in-bash-generating-sequences\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"Understanding Brace Expansion in Bash: Generating Sequences"}]},{"@type":"WebSite","@id":"https:\/\/smarttech101.com\/#website","url":"https:\/\/smarttech101.com\/","name":"SmartTech101","description":"Do Everything in Linux","publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smarttech101.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633","name":"Ajay Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","width":180,"height":60,"caption":"Ajay Yadav"},"logo":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334","name":"Ajay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","caption":"Ajay"},"sameAs":["https:\/\/x.com\/ajay_yadav"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/08\/Understanding-Brace-Expansion-in-Bash-Generating-Sequences.png?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2932"}],"collection":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/comments?post=2932"}],"version-history":[{"count":2,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2932\/revisions"}],"predecessor-version":[{"id":2936,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2932\/revisions\/2936"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/2935"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=2932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=2932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=2932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}