LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 06-12-2006, 08:30 AM   #1
linuxtesting2
Member
 
Registered: Mar 2004
Location: Norway
Distribution: Freebsd, Fedora, Redhat, Solaris 10
Posts: 169

Rep: Reputation: 30
soft links


Hi,

Solaris 10
x86


Im just wondering why the following file does not show which file it is linked to, it only show -->


root@pimpking {/proc/12971] #ls -la
total 3610
dr-x--x--x 5 root root 864 Jun 12 15:21 .
dr-xr-xr-x 60 root root 125632 Jun 12 15:25 ..
-rw------- 1 root root 1683456 Jun 12 15:21 as
-r-------- 1 root root 168 Jun 12 15:21 auxv
dr-x------ 2 root root 32 Jun 12 15:21 contracts
-r-------- 1 root root 72 Jun 12 15:21 cred
--w------- 1 root root 0 Jun 12 15:21 ctl
lr-x------ 1 root root 0 Jun 12 15:21 cwd ->
dr-x------ 2 root root 8208 Jun 12 15:21 fd


root@pimpking {/proc/12971/cwd] #ls -l
lr-x------ 1 root root 0 Jun 12 15:21 . ->
root@pimpking {/proc/12971/cwd]

Is it a dead link ?



And another question, is there any easy way to get colors with ls command in Solaris, or do i haveto install lscolor ?


Ole
 
Old 06-12-2006, 12:37 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by linuxtesting2

Im just wondering why the following file does not show which file it is linked to, it only show -->

root@pimpking {/proc/12971/cwd] #ls -l
lr-x------ 1 root root 0 Jun 12 15:21 . ->
root@pimpking {/proc/12971/cwd]

Is it a dead link ?
Although they do not show the target name, these links do actually point to the expected targets (current working directory and directory root for the process), this is a feature of the Solaris procfs filesystem.

From the OpenSolaris source code /usr/src/uts/common/fs/proc/prvnops.c:
/*
* There are 4 special files in the path directory: ".", "..",
* "root", and "cwd". We handle those specially here.
*/


You can check the links with "ls -Lid" and verify the inode match the expected one.

The "pwdx <pid>" command can be used to see where cwd points.

Quote:
And another question, is there any easy way to get colors with ls command in Solaris, or do i haveto install lscolor ?
You need to install lscolor if you want this (annoying?) feature.
 
Old 06-12-2006, 02:39 PM   #3
linuxtesting2
Member
 
Registered: Mar 2004
Location: Norway
Distribution: Freebsd, Fedora, Redhat, Solaris 10
Posts: 169

Original Poster
Rep: Reputation: 30
Thanks for clearing my mind...


I like ls with color, used this allways with Linux. Makes it easier for newbies to see whats links, dir, files etc, with just the ls command, and not ls -l


Ole
 
  


Reply



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
links (hard links and soft links..) sachitha Programming 1 08-10-2005 12:10 PM
Soft Links varunbihani Linux - Newbie 3 06-04-2005 11:42 PM
Hard/Soft Links nodger Linux - General 1 05-15-2004 10:36 AM
Soft Links tonphi Red Hat 1 09-22-2003 09:20 PM
Soft Links Resqtech Linux - Newbie 4 08-26-2001 10:00 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration