Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Copy where ..... Bash script help

Featured Replies

I have the following directory structure on disk6, and I want to copy all the directories that have a PB in front of the name.  Is this possible using a bash script? 

 

In this example the Sally Smith directory would be copied but the Polly Pocket and Wendy Wong directory would not be copied.  The full directory structure needs to be replicated, and the copied files will end up on a new disk, say /mnt/disk16

 

/mnt/disk6

  2013

    2013-01 Jan

        [2013-01-02] PB Smith, Sally

              lots of files......

        [2013-01-04] PPW Pocket, Polly

              lots of files......

    2013-02 Feb

        [2013-02-06] Wong, Wendy

              lots of files......

    2013-03 Mar

    2013-04 Apr

 

 

  • 3 weeks later...

My router has dd-wrt on it and has a very complicated looking vpn section. Definitely not my field, would really apoeciate your help with that but if the wol would work over wan that would be far simpler.

  • Author

I have the following directory structure on disk6, and I want to copy all the directories that have a PB in front of the name.  Is this possible using a bash script? 

My router has dd-wrt on it and has a very complicated looking vpn section. Definitely not my field, would really apoeciate your help with that but if the wol would work over wan that would be far simpler.

 

Ummm, did you post to the wrong thread?? 

Looks like he did post on the wrong thread.

 

His answer, no, WOL  (Wake-on-LAN) on WAN port of a router is not going to be a good idea.

 

Your long awaited pointer is the find command. You will have to play with things to make sure, but I think you want to the string " PB " and use the option -type d which will report only directories. Since the string is the directory, not filename, the -name option is not useful, use -path instead.

 

find /mnt/disk16 -type d -path "* PB *"

 

Check the output and pipe to xargs for your copy (cp)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.