Tiny Core Base > TCB Q&A Forum

listing links (ls -l)

(1/2) > >>

jpeters:
I'm not sure why 'ls -ld' doesn't show the link with .files in $HOME, although they show up as links with emelfm.  Is there some other option I should be using?   Also 'du -h' follows the link as well.

robc:
I don't quite understand what you are asking...but would "ls -lda" work?

combo3:
The -d switch requires extra arguments.

Visible directories: ls -ld */

Hidden directories: ls -ld .*/

All directories: ls -d .*/ */

To list everything, including sudirectories use: ls -laR

To list only links: ls -aR | grep ^l

jpeters:
Okay, so as combo3 noted,  "ls -lda" or "ls -ld"  needs the extra  ".*" arg, and then correctly lists all the links:

tc@box:~$ ls -lda .*

--- Code: ---lrwxrwxrwx    1 root     root           35 Sep 24 09:13 .openoffice.org2 -> /mnt/hda3/Desktop/.openoffice.org2//

--- End code ---

If I try to list only the .openoffice.org link, however:

tc@box:~$ ls -lda  .openoffice.org2/

--- Code: ---drwxr-sr-x    3 tc       staff        4096 Sep 24 17:57 .openoffice.org2//

--- End code ---


--- Code: ---tc@box:~$ ls -la .openoffice.org2/
drwxr-sr-x    3 tc       staff        4096 Sep 24 17:57 ./
drwxr-xr-x   14 tc       staff        4096 Sep 24 08:37 ../
drwxr-sr-x   12 tc       staff        4096 Sep 24 08:24 user/

--- End code ---

Edit: Interesting....the same goes with "du -h", which requires the ".*" or it follows the link:

du -h

--- Code: ---2.0M    .openoffice.org2/

--- End code ---

du -h .*

--- Code: ---
0       .openoffice.org2

--- End code ---

"du -h .openoffice.org2" also follows the link (lists all the files, ending with 2.0M .openoffice.org2/)

Thanks!

combo3:
When the argument is a specific directory name, "-d" lists only the directory name.

Navigation

[0] Message Index

[#] Next page

Go to full version