Sponsored Content
Full Discussion: Move directory + sub dirs
Top Forums UNIX for Dummies Questions & Answers Move directory + sub dirs Post 302355029 by zaxxon on Monday 21st of September 2009 09:29:04 AM
Old 09-21-2009
If you can become root, do something like this maybe:
Code:
cd /somedir/somesubdir
find .| cpio -dumpv /newdir/whatever

This will copy all contents of /somedir/somesubdir 1:1 in terms of permissions, ownership, date/time etc. to the path given with cpio.

If access is not ok by means of chown and chgrp root will have to correct ownership and group anyway.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

2. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

3. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

4. UNIX for Dummies Questions & Answers

**HELP** how to do a listing of dirs and all sub dirs only

I am trying to get a listing of ALL directories only under /export (as an example). I can get all the dirs directly under /export but I need any sub dirs under those dirs. I've looked (here and google) but can not find anything that works (4 Replies)
Discussion started by: bbraml
4 Replies

5. UNIX for Dummies Questions & Answers

Zip all files in a directory and move to another directory

Hi, need to zip all files in a directory and move to another directory after the zip.. i am using this one but didnt help me... zip -r my_proj_`date +%Y%m%d%H%MS`.zip /path/my_proj mv in_proj_`date +%Y%m%d%H%M%S`.zip /path/source/ i am trying to zip all the files in my_proj... (0 Replies)
Discussion started by: dssyadav
0 Replies

6. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

7. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies

8. Shell Programming and Scripting

How Create new directory and move files to that directory.?

Hi All, We have main directory called "head" under this we have several sub directories and under these directories we have sub directories. My requirement is I have to find the SQL files which are having the string "procedure" under "head" directory and sub directories as well. And create... (14 Replies)
Discussion started by: ROCK_PLSQL
14 Replies

9. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies
rpm2cpio(1)							   User Commands						       rpm2cpio(1)

NAME
rpm2cpio - convert Red Hat Package (RPM) to cpio archive SYNOPSIS
rpm2cpio [file.rpm] DESCRIPTION
The rpm2cpio utility converts the .rpm file specified as its sole argument to a cpio archive on standard output. (See NOTES.) If no argu- ment is given, an rpm stream is read from standard input. In both cases, rpm2cpio will fail and print a usage message if the standard out- put is a terminal. Therefore, the output is usually redirected to a file or piped through the cpio(1) utility. EXAMPLES
Example 1 Converting an rpm file example% rpm2cpio Device3Dfx-1.1-2.src.rpm | cpio -itv CPIO archive found! -rw-r--r-- 1 root root 2635 Sep 13 16:39 1998, 3dfx.gif -rw-r--r-- 1 root root 11339 Sep 27 16:03 1998, Dev3Dfx.tar.gz -rw-r--r-- 1 root root 1387 Sep 27 16:04 1998, Device3Dfx-1.1-2.spec 31 blocks Example 2 Converting from standard input example% rpm2cpio < Device3Dfx-1.1-2.src.rpm | cpio -itv CPIO archive found! -rw-r--r-- 1 root root 2635 Sep 13 16:39 1998, 3dfx.gif -rw-r--r-- 1 root root 11339 Sep 27 16:03 1998, Dev3Dfx.tar.gz -rw-r--r-- 1 root root 1387 Sep 27 16:04 1998, Device3Dfx-1.1-2.spec 31 blocks ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWrpm | +-----------------------------+-----------------------------+ SEE ALSO
cpio(1), attributes(5) NOTES
rpm2cpio handles versions 3 and 4 RPMs. SunOS 5.11 20 Aug 2001 rpm2cpio(1)
All times are GMT -4. The time now is 01:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy