Sponsored Content
Top Forums UNIX for Dummies Questions & Answers find mv and create directory structure Post 302494269 by fistikuffs on Sunday 6th of February 2011 03:41:37 PM
Old 02-06-2011
find mv and create directory structure

Hi there, I'm trying to pull all my flacs out of my Music collection. I can do it with following command
Code:
find b/ -name *.flac -exec mv {} flac/ \;

which works great except it moves all the flac files to the flac folder. I want it to recreate the original folder the flacs were found in and mv the files there. essentially recreate directory structure but only folders with flac files. Can anyone help please?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying a Directory Structure to a new structure

Hi all Is it possible to copy a structure of a directory only. e.g. I have a file with the following entries that is a result of a find :- /dir1/dir2/file.dbf /dir1/dir2/dir3/file1.dbf /dir1/file.dbf I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies

2. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

3. Shell Programming and Scripting

stop unix find on a directory structure after finding 1st occurrence

Hi, Has anyone tried to restrict Solaris 10 unix find on a large directory structure based on time to stop running after finding the first occurrence of a matching query. Basically I'm trying to build up a usage map of user workspaces based on file modification (week/month/3 months/year etc) and... (3 Replies)
Discussion started by: jm0221
3 Replies

4. Shell Programming and Scripting

How to create a directory structure with getting input from a file.

Hi How to create a directory structure with getting input from a file. I have file in that following lines are written. ./activemq-4.1.2/activemq-core-4.1.2.jar ./activemq-4.1.2/backport-util-concurrent-2.1.jar ./camel-1.4.0/apache-camel-1.4.0.jar ./camel-1.4.0/lib/activation-1.1.jar... (12 Replies)
Discussion started by: itsjoy2u
12 Replies

5. UNIX for Dummies Questions & Answers

create tar archive without preserving directory structure?

I am adding some individual files to a tar archive and would like them to be added to the archive without any directory hierarchy, even though the files themselves exist in levels of hierarchy. Unfortunately, tar seems to always preserve the directory hierarchy when it adds the files. Here is... (2 Replies)
Discussion started by: Special_K
2 Replies

6. Shell Programming and Scripting

Find directory and create backup

What I'm attempting to do is create a script that will do a search for directories that meet the following criteria: find . -name "config" -type d this comes back with: ./dir1/anotherDir/test_dir/config ./dir1/anotherDir/test_dira/config ./dir2/test/test_dir/config The results could... (4 Replies)
Discussion started by: cbo0485
4 Replies

7. Shell Programming and Scripting

find size, cp breaks directory structure

I'm using this now: find /some/path/with/sourcefiles -type f -size -7M -exec /bin/cp -uv {} /some/path/ \; but it doesn't preserve the directory structure, also I've tried it with find /some/path/with/sourcefiles -type f -size -7M -exec /usr/bin/rsync -auv {} /some/path/ \; but that doesn't... (9 Replies)
Discussion started by: unclecameron
9 Replies

8. Shell Programming and Scripting

How we can create the master file through shell to show the tree structure of the directory?

Can we create the master file that show the whole tree structure of the directory till a particular folder? Database that contains four sub repository Sybase,sql,oracle,mysql and sql and oracle contains two subrepostories Siebel and plsql and each repositories contains three folders... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

9. Shell Programming and Scripting

Create Directory structure

Hello ; ) again Now I have my file like this : DIR2/DIR3 DIR2 DIR2/DIR3/DIR4/DIR5 I am looking for help to create a loop that will create the directory structure. I need something like this : If "DIR2" does not exist > Create IF "DIR2" exist already > check if onther "DIR"... (5 Replies)
Discussion started by: Aswex
5 Replies

10. Shell Programming and Scripting

Create a flat file and directory structure

Hi All, is there any work around to generate the file and directory structure like below at left side at Output? and exclude all file except .abc .txt Current Directory structure |-------------files |---------------Share |-----------------dir1 |-----------------dir2... (11 Replies)
Discussion started by: heros
11 Replies
OCP(1)							      General Commands Manual							    OCP(1)

NAME
ocp - music player SYNOPSIS
ocp [ options ] [ playlist ] [ modulename ] DESCRIPTION
This manual page documents briefly the ocp command. ocp is a music player which can play music modules (it, s3m, xm, mod), wave, audio CD, sid, midi, mp3, adlib, flac, ym, and ogg vorbis. The player has a built-in file selector which can be configured using alt-c. Press f1 for the online help. To use the graphical output mode see your ~/.ocp/ocp.ini configuration file. OPTIONS
-h Show summary of options. -c Use specific configuration. -f Fileselector settings -v Sound settings -s Device settings -p Quit when playlist is empty. EXAMPLE
ocp -fl0,r1 -vp75,f2 -spdevpdisk -sr48000 fegolhuz.xm Renders the module to HD. SEE ALSO
You can find a more detailed document at http://www.cubic.org/player/opencp.pdf. file:///usr/share/doc/opencubicplayer-doc/ oggenc(1), flac(1), lame(1). AUTHOR
Open Cubic Player was written by Niklas Beisert and ported to Linux by Stian Sebastian Skjelstad. This manual page was written by Gurkan Sengun <gurkan@linuks.mine.nu>, for the Debian project (but may be used by others). December 26, 2006 OCP(1)
All times are GMT -4. The time now is 05:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy