LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 04-05-2008, 09:03 AM   #1
asmar
LQ Newbie
 
Registered: Oct 2004
Location: To the best place in the world...Greece
Distribution: Debian, SuSE, CentOS, Solaris, Ubuntu
Posts: 25

Rep: Reputation: 15
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
 
Old 04-05-2008, 10:15 AM   #2
asmar
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: Reputation: 15
Just found it...
I need to use find and cpio to achieve the same.
 
Old 04-05-2008, 10:23 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 04-05-2008, 11:09 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,493

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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.
 
  


Reply

Tags
cp, linux, solaris


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying files exelte Ubuntu 1 05-22-2007 12:04 PM
Copying Large File via SSH/SFTP over WiFi link Always Stalls and Freezes Host Haz2a Linux - Wireless Networking 1 03-16-2007 03:35 PM
Copying files rvsridhar Linux - General 5 03-23-2006 04:06 AM
copying files neozero62 Linux - Newbie 1 11-23-2003 05:38 PM
copying files Sol0 Linux - Software 7 08-18-2003 10:40 AM


All times are GMT -5. The time now is 09:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration