Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: jpeters on September 24, 2009, 12:27:08 PM
-
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.
-
I don't quite understand what you are asking...but would "ls -lda" work?
-
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
-
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 .*
lrwxrwxrwx 1 root root 35 Sep 24 09:13 .openoffice.org2 -> /mnt/hda3/Desktop/.openoffice.org2//
If I try to list only the .openoffice.org link, however:
tc@box:~$ ls -lda .openoffice.org2/
drwxr-sr-x 3 tc staff 4096 Sep 24 17:57 .openoffice.org2//
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/
Edit: Interesting....the same goes with "du -h", which requires the ".*" or it follows the link:
du -h
2.0M .openoffice.org2/
du -h .*
0 .openoffice.org2
"du -h .openoffice.org2" also follows the link (lists all the files, ending with 2.0M .openoffice.org2/)
Thanks!
-
When the argument is a specific directory name, "-d" lists only the directory name.
-
When the argument is a specific directory name, "-d" lists only the directory name.
It would be nice, however, if "ld" showed the link, but at least with ".*" I can see it. Maybe there's some way to see the individual link, but haven't found it yet.
-
I gues you are playing with the commands provided by Busybox. As an option you can install coreutils to have the "real" tool set. It may behave differently. Did not try with these commands, just an idea.
-
It seems the results are dependent on whether your directory name ends with a trailing /
tc@box:~$ ls -lad .boot
lrwxrwxrwx 1 tc staff 14 Sep 25 08:35 .boot -> /mnt/hda1/boot/
tc@box:~$ ls -lad .boot/
drwxr-xr-x 6 root root 1024 Sep 22 10:44 .boot//
tc@box:~$ ls -la .boot
lrwxrwxrwx 1 tc staff 14 Sep 25 08:35 .boot -> /mnt/hda1/boot/
tc@box:~$ ls -la .boot/
drwxr-xr-x 6 root root 1024 Sep 22 10:44 ./
drwxr-xr-x 10 root root 1024 Sep 22 10:43 ../
drwxr-xr-x 2 root root 1024 Sep 8 20:02 grub/
drwxr-xr-x 2 root root 1024 Sep 2 14:40 tc143/
drwxr-xr-x 2 root root 1024 Sep 2 09:31 tc220/
drwxr-xr-x 3 root root 1024 Sep 16 11:15 tc231/
With it, ls displays the contents of the linked directory; without it, you get the contents of the current one.
-
It seems the results are dependent on whether your directory name ends with a trailing /
tc@box:~$ ls -lad .boot
lrwxrwxrwx 1 tc staff 14 Sep 25 08:35 .boot -> /mnt/hda1/boot/
tc@box:~$ ls -lad .boot/
drwxr-xr-x 6 root root 1024 Sep 22 10:44 .boot//
tc@box:~$ ls -la .boot
lrwxrwxrwx 1 tc staff 14 Sep 25 08:35 .boot -> /mnt/hda1/boot/
tc@box:~$ ls -la .boot/
drwxr-xr-x 6 root root 1024 Sep 22 10:44 ./
drwxr-xr-x 10 root root 1024 Sep 22 10:43 ../
drwxr-xr-x 2 root root 1024 Sep 8 20:02 grub/
drwxr-xr-x 2 root root 1024 Sep 2 14:40 tc143/
drwxr-xr-x 2 root root 1024 Sep 2 09:31 tc220/
drwxr-xr-x 3 root root 1024 Sep 16 11:15 tc231/
With it, ls displays the contents of the linked directory; without it, you get the contents of the current one.
How is this different than the coreutils ls?
-
It seems the results are dependent on whether your directory name ends with a trailing /
tc@box:~$ ls -lad .boot
lrwxrwxrwx 1 tc staff 14 Sep 25 08:35 .boot -> /mnt/hda1/boot/
tc@box:~$ ls -lad .boot/
drwxr-xr-x 6 root root 1024 Sep 22 10:44 .boot//
ah.......that's it! Mine automatically includes "/" when I use the tab key to complete it.
tc@box:~$ ls -ld .openoffice.org2/
drwxr-sr-x 3 tc staff 4096 Sep 24 17:57 .openoffice.org2//
tc@box:~$ ls -ld .openoffice.org2
lrwxrwxrwx 1 root root 35 Sep 25 01:48 .openoffice.org2 -> /mnt/hda3/Desktop/.openoffice.org2//
Thanks for finding this, combo3 ;)
note: "ls -ld" works
bigpcman: When I tried coreutils, it was doing the same thing. I assume removing the "/" will also work (haven't tried it).