Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
04-05-2008, 09:03 AM
#1
LQ Newbie
Registered: Oct 2004
Location: To the best place in the world...Greece
Distribution: Debian, SuSE, CentOS, Solaris, Ubuntu
Posts: 25
Rep:
link files instead of copying
Hello all,
I need to execute the following command into a Solaris 5.11 system.
cp -al ......
The problem is that either -a or -l works on Solaris.
Man pages are not installed and all I can get is:
Usage: cp [-f] [-i] [-p] [-@] f1 f2
cp [-f] [-i] [-p] [-@] f1 ... fn d1
cp -r|-R [-H|-L|-P] [-f] [-i] [-p] [-@] d1 ... dn-1 dn
What I want to achieve is link files instead of copying and also keep permissions on files.
Any help is much appreciated.
Thanks
04-05-2008, 10:15 AM
#2
LQ Newbie
Registered: Oct 2004
Location: To the best place in the world...Greece
Distribution: Debian, SuSE, CentOS, Solaris, Ubuntu
Posts: 25
Original Poster
Rep:
Just found it...
I need to use find and cpio to achieve the same.
04-05-2008, 10:23 AM
#3
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263
Since these are links, the permissions will be the same.
Code:
ll
total 4
-rwxrw-r-- 1 jschiwal jschiwal 0 Apr 5 10:20 abcd
jschiwal@hpamd64:~/demo> mkdir temp
jschiwal@hpamd64:~/demo> cp -l abcd temp/
jschiwal@hpamd64:~/demo> ls -l abcd temp/abcd
-rwxrw-r-- 2 jschiwal jschiwal 0 Apr 5 10:20 abcd
-rwxrw-r-- 2 jschiwal jschiwal 0 Apr 5 10:20 temp/abcd
jschiwal@hpamd64:~/demo> chmod o-r temp/abcd
jschiwal@hpamd64:~/demo> ls -l abcd temp/abcd
-rwxrw---- 2 jschiwal jschiwal 0 Apr 5 10:20 abcd
-rwxrw---- 2 jschiwal jschiwal 0 Apr 5 10:20 temp/abcd
I don't have solaris, so you may want to verify this yourself.
04-05-2008, 11:09 AM
#4
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165
You are using non standard Gnu cp extensions.
Just use /usr/gnu/bin/cp on Solaris Express (a.k.a. SunOS 5.11) to get them, and indeed copying the permission while linking is pointless.
Last edited by jlliagre; 04-05-2008 at 11:11 AM .
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 11:50 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News