I want to know how many directories and files are there in a directory and if the sub directory have any files i also need that also .
I have done this far .... (4 Replies)
Hello,
Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories.
The files names don't follow any defined rule, so they can be just letters without (.) period
Directory structure example: ... (0 Replies)
I have searched about 30 threads, a load of Google pages and cannot find what I am looking for. I have some of the parts but not the whole. I cannot seem to get the puzzle fit together.
I have three folders, two of which contain different versions of multiple files, dist/file1.php dist/file2.php... (4 Replies)
i have a c-shell script.
and i pass it one or two arguments
the first argument is the directory
the second is the "-r"
now,
if i pass it only one, it searches the files ending in txt in that directory
if i pass it two parameters, like "temp" and "-r"
i want it to go through all the files and... (1 Reply)
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
Find all files in the current directory only excluding hidden directories and files.
For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided.
`find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
I need a hint for extracting and copying only the loads of .mp3 files from one directory and its subdirectories to get them all into only one directory. This way I am doing gives me a identical copy with hundreds of subdirectories. But I just don't get it to extract only the files. Though I tried... (9 Replies)
Hello,
Server A: /directory1/
Server B: /Backups/
i wanted to backup contents of /directory1 from "server A" on to "Server B" every 1 hour.
If there is any change in (only new/differences) contents on serverA (directory1/) supposed to be backeup on next run.
I did used rsync command to... (5 Replies)
Hi,
I want a simple line of code that will compress files within a directory specified (parameter) and its subdirectories and also i want to remove files which are exactly 365 days old from the sysdate after this compression.
Please help.
Thanks,
JD (8 Replies)
Discussion started by: Jesshelle David
8 Replies
LEARN ABOUT ULTRIX
cp
cp(1) General Commands Manual cp(1)Name
cp - copy file data
Syntax
cp [ -f ] [ -i ] [ -p ] file1 file2
cp [ -f ] [ -i ] [ -p ] [ -r ] file... directory
cp [ -f ] [ -i ] [ -p ] [ -r ] directory... directory
Description
The command copies file1 onto file2. The mode and owner of file2 are preserved if it already existed; the mode of file1 is used otherwise.
Note that the command will not copy a file onto itself.
In the second form, one or more files are copied into the directory with their original file names.
In the third form, one or more source directories are copied into the destination directory with their original file names.
Options-f Forces existing destination pathnames to be removed before copying, without prompting for confirmation. The -i option is ignored if
the -f option is specified.
-i Prompts user with the name of file whenever the copy will cause an old file to be overwritten. A yes answer will cause to continue.
Any other answer will prevent it from overwriting the file.
-p Preserves (duplicates) in the copies the modification time, access time, file mode, user ID, and group ID as allowed by the permis-
sions of the source files, ignoring the present umask.
-r Copies directories. Entire directory trees, including their subtrees and the individual files they contain, are copied to the speci-
fied destination directory. The directory, its subtrees, and the individual files retain their original names. For example, to copy
the directory including all of its subtrees and files, into the directory enter the following command:
cp -r reports news
See Alsocat(1), pr(1), mv(1)cp(1)