LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2013, 12:22 PM   #1
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Rep: Reputation: Disabled
Symbolic Link


How to record the symbolic link's size and the name of the file it references?
 
Old 12-12-2013, 12:26 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Not entirely sure what you want, but the following shows the real size etc instead of the symbolic link name and attributes:
Code:
ls -lL
This from the manual page:
Quote:
-L, --dereference when showing file information for a symbolic link, show information for the file the link references rather than for the link itself
 
Old 12-12-2013, 01:24 PM   #3
ondoho
Senior Member
 
Registered: Dec 2013
Posts: 4,176

Rep: Reputation: 837Reputation: 837Reputation: 837Reputation: 837Reputation: 837Reputation: 837Reputation: 837
if "record" means "show", then ls can show you a lot.
open a terminal, type:
Code:
man ls
you can always redirect its output to a file, if that's what you mean by "record":
Code:
ls -lL > ls.txt
if you mean something else, please explain!
maybe you want to extract only symbolic links' info from ls' output?

Last edited by ondoho; 12-12-2013 at 03:33 PM.
 
Old 12-12-2013, 05:54 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
you can also use the "stat" command to see all the information about a file (directory, link, whatever).
 
Old 12-13-2013, 12:39 AM   #5
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 512

Rep: Reputation: 139Reputation: 139
Speaking of soft links, if the link is created by relative path, you can use readlink to find its actual path.

Code:
$ ls -l ifup
lrwxrwxrwx. 1 root root 18 Dec  3 13:08 ifup -> ../../../sbin/ifup

$ readlink -f ifup
/sbin/ifup
 
  


Reply


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
[SOLVED] Can I make a symbolic link that is dynamic link->$HOME/file? croog Linux - General 4 10-14-2012 08:55 PM
Symbolic link not allowed or link target not accessible rheluser Linux - Server 3 09-04-2012 11:22 AM
symbolic link not allowed or link target not accessible paullaubscher Linux - Newbie 4 03-10-2010 07:47 AM
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 08:40 AM
Symbolic link bwaynej2002 Linux - General 8 08-25-2003 11:06 PM


All times are GMT -5. The time now is 11:05 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration