07-06-2011
Copy files and subdirs from dir to a new dir
Hello Comunity
I am trying to make a bash shell script that it copies files and subdirs(with files) to a new dir. I would like the dest_dir to contain only subdirectories with files not other subdirs inside.
it called : cpflatdir src_dir dest_dir
Pleaze help me!
Thank you in advise
Last edited by BTKBaaMMM; 12-09-2011 at 01:13 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
fjalkdsjfkldsajflkajdskl (3 Replies)
Discussion started by: pmeesara
3 Replies
2. UNIX and Linux Applications
HI all, I got a CPIO archive that contains a unix filesystem that I try to extract, but it extract to the root dir / unstead of current dir, and happily it detects my file are newer otherwise it would have overwrited my system's file!
I tried all these commands
cpio -i --make-directories <... (2 Replies)
Discussion started by: nekkro-kvlt
2 Replies
3. Shell Programming and Scripting
Greetings!
I have multiple files, one per subdirectory, all with the same file name. All subdirectories are one level deep from the main directory.
The data in the files is tab delimited between fields and record delimited with a newline.
The subdirectory names have the date in the... (5 Replies)
Discussion started by: vtischuk@yahoo.
5 Replies
4. Shell Programming and Scripting
Hello!!
I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory:
drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies
5. Shell Programming and Scripting
Hi,
I have one dir which has N subdirs.For ex:
/home/user/Project_Src
/home/user/Project_Src/Dir_A
/home/user/Project_Src/Dir_A/subdir/sub_dir2
/home/user/Project_Src/Dir_A/subdir/sub_dir3
/home/user/Project_Src/Dir_B
/home/user/Project_Src/Dir_B/Build
i want to create a folder with... (2 Replies)
Discussion started by: dragon.1431
2 Replies
6. UNIX for Dummies Questions & Answers
I am very new to unix as well as shell scripting.
I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file
Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies
7. Shell Programming and Scripting
Dear Members,
I have a list of xml files like
abc.xml.table
prq.xml.table
...
..
.
in a txt file.
Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file.
Please help me with the script or command to do so.
... (11 Replies)
Discussion started by: Yoodit
11 Replies
8. Emergency UNIX and Linux Support
du -hs command calculates the space for all the subdirs under a dir ...but it is very slow if the dir is huge....is there any quick way ...I am using Sun OS.
Thanks,
Ajay (19 Replies)
Discussion started by: ajaypatil_am
19 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I would like to list all files, older than 7 days, in a directory, but exclude all subdirectories in the find command. If I use find . -type f -mtime +7 all files in the subdirs are also included. How can I exclude them?
Regards,
JW (6 Replies)
Discussion started by: jwbijl
6 Replies
10. AIX
I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies
GATHER(1) General Commands Manual GATHER(1)
NAME
gather - gather up the files in a directory for transmission
SYNOPSIS
gather [-s] source_dir [-d] dest_dir [-b] bytes [-f] file
OPTIONS
-b Desired number of bytes per output file
-d Destination directory
-f Base name of output files
-s Source directory
EXAMPLES
gather # Collect files in current dir into 60K archives
gather -d dir # Put the archives in dir
gather -b 90000 # Try to produce 90K archives
gather -s .. -d targ -b 5000
# Try to produce 5K archives
DESCRIPTION
It is often useful to collect all the files in a directory into one or more archives for transmission by mail. This program collects all
the files in the source directory (default: current directory) and puts them into a shar archive. The shar archive is then compressed and
uuencoded. An attempt is made to have the final .uue file be about the given size (default: 60K), but since gather cannot really predict
how much shar will add to the file, how much compress will reduce the file, and how much uue will add again, the sizes can fluctuate. If
the -f file flag is given, the archives will be given the names file_00.uue, file_01.uue etc. If -f is not given, the name of the source
directory is used as the base name. Since 7 characters of suffix are appended, the base name should not exceed 7 characters.
GATHER(1)