Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. #TIL you can create multiple folders under a directory with a single command.

#TIL you can create multiple folders under a directory with a single command.

Scheduled Pinned Locked Moved Uncategorized
til
5 Posts 5 Posters 25 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • box464@mastodon.socialB This user is from outside of this forum
    box464@mastodon.socialB This user is from outside of this forum
    box464@mastodon.social
    wrote last edited by
    #1

    #TIL you can create multiple folders under a directory with a single command.

    `mkdir -p cool-fedi-project/{postgres-data,redis-data}`

    Which creates cool-fedi-project and then both postgres-data and redis-data underneath!

    varpie@peculiar.floristV wtl@mastodon.socialW michael@westergaard.socialM 3 Replies Last reply
    0
    • box464@mastodon.socialB box464@mastodon.social

      #TIL you can create multiple folders under a directory with a single command.

      `mkdir -p cool-fedi-project/{postgres-data,redis-data}`

      Which creates cool-fedi-project and then both postgres-data and redis-data underneath!

      varpie@peculiar.floristV This user is from outside of this forum
      varpie@peculiar.floristV This user is from outside of this forum
      varpie@peculiar.florist
      wrote last edited by
      #2

      @box464 You can even have that in the middle of the path, so you could have written it as mkdir -p cool-fedi-project/{postgres,redis}-data

      1 Reply Last reply
      0
      • box464@mastodon.socialB box464@mastodon.social

        #TIL you can create multiple folders under a directory with a single command.

        `mkdir -p cool-fedi-project/{postgres-data,redis-data}`

        Which creates cool-fedi-project and then both postgres-data and redis-data underneath!

        wtl@mastodon.socialW This user is from outside of this forum
        wtl@mastodon.socialW This user is from outside of this forum
        wtl@mastodon.social
        wrote last edited by
        #3

        @box464 Okay, that is *neat* and very handy. <bookmarks>

        randomized@masto.bikeR 1 Reply Last reply
        0
        • wtl@mastodon.socialW wtl@mastodon.social

          @box464 Okay, that is *neat* and very handy. <bookmarks>

          randomized@masto.bikeR This user is from outside of this forum
          randomized@masto.bikeR This user is from outside of this forum
          randomized@masto.bike
          wrote last edited by
          #4

          @WTL

          @box464

          Saving it to impress my next date

          1 Reply Last reply
          0
          • box464@mastodon.socialB box464@mastodon.social

            #TIL you can create multiple folders under a directory with a single command.

            `mkdir -p cool-fedi-project/{postgres-data,redis-data}`

            Which creates cool-fedi-project and then both postgres-data and redis-data underneath!

            michael@westergaard.socialM This user is from outside of this forum
            michael@westergaard.socialM This user is from outside of this forum
            michael@westergaard.social
            wrote last edited by
            #5

            That’s a standard shell feature. A more efficient way of writing same is

            mkdir -p cool-fedi-project/{postgres,redis}-data

            or even

            mkdir -p cool-fedi-project/{postgre,redi}s-data

            It also supports ranges, e.g.,

            mkdir -p cool-fedi-project/data-{0..5}

            creates 6 folders. They can be combined

            mkdir -p cool-fedi-project/{a..z}-data-{0..9}{0..9}

            creates 2600 folders (26 from letters, 100 2-digit numbers)

            mkdir -p cool-fedi-project/{a..z}-data-{0..99}

            Also creates 2600 folders, but with a mix of single and double digit numbers.

            1 Reply Last reply
            1
            0
            • R relay@relay.infosec.exchange shared this topic
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups