Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Copying multiple directories at the same time using Unix Post 60409 by Neo on Sunday 16th of January 2005 09:33:18 PM
Old 01-16-2005
You could try to use regular expressions in PERL or PHP.....

With a simply shell utility like cp, you will have difficulties because cp does not use regular expressions to match patterns....

Neo
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

copying to multiple directories using wildcard

Can we copy a file to multiple directories using a single command line , i tried with * didnt work for me cp /tmp/a.kool /tmp/folder/*/keys/ I am tryn to copy a.kool file to all keys folder in /tmp folder. is something i am missing ? (4 Replies)
Discussion started by: logic0
4 Replies

2. UNIX for Dummies Questions & Answers

copying directories from NT server to Unix server (solaris 5.8)

I need to copy around 30 directories (each directory include one or more text file(s)) from NT server to Unix server at one go. For doing this what are the privillages i should have in both NT and Unix server. Please let me know which command i can use in shell prompt. TIA. (4 Replies)
Discussion started by: jhmr7
4 Replies

3. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

4. UNIX for Dummies Questions & Answers

Deleting multiple directories inside multiple directories

Hi, Very unfamiliar with unix/linux stuff. Our admin is on vacation so, need help very quickly. I have directories (eg 40001, 40002, etc) that each have one subdirectory (01). Each subdir 01 has multiple subdirs (001, 002, 003, etc). They are same in each dir. I need to keep the top and... (7 Replies)
Discussion started by: kkouraus1
7 Replies

5. Shell Programming and Scripting

listing directories and sub directories with time and name options

Hello all! I'm looking to list directories and sub-directories of a path, on this forum I found this command: find $path -type d -exec ls -ld {} \; The issue I have is that with a simple ls, the list is listed by name, and using -t I get it by time. How could I list directories and sub... (5 Replies)
Discussion started by: nomadvisuals
5 Replies

6. UNIX for Advanced & Expert Users

Help with Calculating time difference between many directories in UNIX

A report needs to come some what similar to this No of elements Stream Batch No Load time A B C D A,B,C im able to get quite easily wc -l /usr/local/intranet/areas/prod/output/SRGW_0?/*/MESSAGE_T.dat O/P of above command. A B C ... (1 Reply)
Discussion started by: peckenson
1 Replies

7. UNIX for Dummies Questions & Answers

copy file using unix in multiple directories

Hi All Genious, I want to copy a file name XYZ .In a directory /HOME/dir/IXOS1/dir1 which contain multiple directories named not in pattern want to copy the XYZ in all of the directories available on path /HOME/dir/IXOS1/dir1 . Thanks in advance . (2 Replies)
Discussion started by: mumakhij
2 Replies

8. UNIX for Dummies Questions & Answers

Copying Directories from one server to another

Hi, I have a requirement where I have to connect to another server and copy directories from one server to another Directories on the Source server look like below (YYYY-MM-DD- 1 to 23) drwxr-xr-x 2 test_user dmfmart 422 Sep 1 23:45 2014-09-01-18 drwxr-xr-x 2 test_user dmfmart ... (3 Replies)
Discussion started by: arunkesi
3 Replies

9. Shell Programming and Scripting

Copying multiple files and appending time stamp before file extension

Hi, I have multiple files that read: Asa.txt Bad.txt Gnu.txt And I want to rename them using awk to Asa_ddmmyytt.txt and so on ... If there is a single command or more efficient executable please share! Thanks! (4 Replies)
Discussion started by: Jesshelle David
4 Replies

10. UNIX for Beginners Questions & Answers

How to read multiple files at same time through UNIX scripting?

How to read multiple files at simultaneously? (1 Reply)
Discussion started by: Priyanka_M
1 Replies
ln(1)							      General Commands Manual							     ln(1)

NAME
ln - link files and directories SYNOPSIS
file1 new_file file1 [file2]... dest_directory directory1 [directory2]... dest_directory DESCRIPTION
The command links: o file1 to a new or existing new_file, o file1 to a new or existing file named file1 in existing dest_directory, o file1, file2, ... to new or existing files of the same name in existing dest_directory, o directory1, directory2, ... to new directories of the same name in existing dest_directory, o or it creates symbolic links between files or between directories. If links are to dest_directory, corresponding file or directory names in that directory are linked to file1, file2, ..., or directory1, directory2, ..., etc., as appropriate. If two or more existing files or directories (excluding destination file name new_file) are speci- fied, the destination must be a directory. If new_file already exists as a regular file (or link to another file), its contents (or the existing link) and its ACL are destroyed only if the option is specified. The ACL on the new_file after the link is the same as that of the source_file file. If the and options are specified and the link being created is the name of an existing link or ordinary file and the access permissions of the file forbid writing, asks permission to overwrite the file. If the access permissions of the directory forbid writing, aborts and returns with the error message: (even if the file is an ordinary file and not a link to another file). When asking for permission to overwrite an existing file or link, prints the mode (see chmod(2) and below), followed by the first letters of the words and in the current native language, prompting for a response, and reading one line from the standard input. If the response is affirmative and is permissible, the operation occurs; if not, the command proceeds to the next source file, if any. Hard links are created with the same ownerships and permissions as the file or directory to which they are linked. If ownership or permis- sions are changed on a link or file, the same changes appear on corresponding hard links. The command does not permit hard links to a directory. Symbolic links are created with the ownership of the creator and the permissions are of the creator's current umask. Once created, the symbolic link ownership and permissions will not change, since the mode and ownership of the symbolic link is ignored by the system. If file1 is a file and new_file is a link to an existing file or an existing file with other links, new_file is disassociated from the existing file and links and linked to file1. When creates a link to a new or existing file name, ownerships and permissions are always identical to those for the file to which it is linked. If or is used to change ownership or permissions of a file or link, the change applies to the file and all associated links. The last modification time and last access time of the file and all associated links are identical (see chown(1) and chmod(1)). For a discussion of symbolic links, see symlink(4). Options The command recognizes the following options: Force existing destination path names to be removed to allow the link. Write a prompt to the standard error output requesting confirmation for each link that would overwrite an existing file. This option takes effect only if used in con- junction with the option. Cause to create symbolic links instead of the usual hard links. A symbolic link contains the name of the file to which it is linked. The referenced file is used when an operation is performed on the link (see open(2)). A on a symbolic link returns the linked-to file; an must be performed to obtain information about the link (see stat(2)). A call can be used to read the contents of the symbolic link (see readlink(2)). Symbolic links may span file systems and refer to directories. Access Control Lists (ACLs) If optional ACL entries are associated with new_file, displays a plus sign after the access mode when asking permission to overwrite the file. If new_file is a new file, it inherits the access control list of file1, altered to reflect any difference in ownership between the two files (see acl(5) and aclv(5)). In JFS file systems, new files created by do not inherit their parent directory's default ACL entries (if any), but instead retain their original ACLs. EXTERNAL INFLUENCES
Environment Variables determines the interpretation of text as single byte and/or multibyte characters. and determine the local language equivalent of (for yes/no queries). determines the language in which messages are displayed. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of (see lang(5)) is used instead of If any internationalization vari- able contains an invalid setting, behaves as if all internationalization variables are set to See environ(5). International Code Set Support Single byte and multibyte character code sets are supported. EXAMPLES
The following command creates and in which are linked back to the original files and If and/or exists in the destination directory, it is removed and replaced by a link to or respectively. If existing file or is a link to another file or a file with links, the existing file remains. Only the link is broken and replaced by a new link to or WARNINGS
does not create hard links across file systems. DEPENDENCIES
NFS Access control lists of networked files are summarized (as returned in by but not copied to the new file. When using on such files, a is not printed after the mode value when asking for permission to overwrite a file. AUTHOR
was developed by AT&T, the University of California, Berkeley and HP. SEE ALSO
cp(1), cpio(1), mv(1), rm(1), link(1M), readlink(2), stat(2), symlink(2), symlink(4), acl(5), aclv(5). STANDARDS CONFORMANCE
ln(1)
All times are GMT -4. The time now is 10:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy