<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 10 Jun 2026 03:39:05 +0000</lastBuildDate>
    <item>
      <title>(Bash) Bash (Command Line): Loop through directories in specified location, replacing directories in current directory (with backup) - karlhorky</title>
      <link>https://snipplr.com/view/35126/bash-command-line-loop-through-directories-in-specified-location-replacing-directories-in-current-directory-with-backup</link>
      <description>&lt;p&gt;This command line aims at moving directories from a target location to the present working directory (pwd), backing the pwd directories up as it encounters them.&#13;
&#13;
The script works by:&#13;
&#13;
1. Iterating through the contents of the target directory (using the unix ls command)&#13;
&#13;
2. Checking whether the current object is a directory&#13;
&#13;
3. Moving the pwd directory to a backup location using the unix mv command&#13;
&#13;
4. Moving the target location's directory to the present working directory&#13;
&#13;
5. Printing out the modified directory's name using the unix echo command&lt;/p&gt;</description>
      <pubDate>Sun, 23 May 2010 15:24:10 UTC</pubDate>
      <guid>https://snipplr.com/view/35126/bash-command-line-loop-through-directories-in-specified-location-replacing-directories-in-current-directory-with-backup</guid>
    </item>
  </channel>
</rss>
