View previous topic :: View next topic |
Author |
Message |
Lyquid n00b
Joined: 25 Jul 2002 Posts: 24 Location: South Lyon, MI
|
Posted: Fri Aug 02, 2002 2:45 pm Post subject: How can I view my currently established "symlinks" |
|
|
If I used the ln-s command to symlink the reference of my DVD drive to my CDROM, how can I tell if a symlink exists? Is it possible to view and remove existing symlinks?
Thanks. |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Fri Aug 02, 2002 2:51 pm Post subject: |
|
|
To check whether a file is a symbolic link, do "ls -l <file_name>". If you see an "l" in the first column of the output, it is a symlink. e.g.,
Code: |
lrwxrwxrwx 1 root root 1 Jun 19 16:22 boot -> .
|
To find symlinks, you can do something like:
Substitute whatever directory you want to search under for "/" above. You can remove a symlink by doing "rm <symlink_name>" just as you would a regular file. To remove all symlinks under a directory hierarchy, you can do:
Code: |
find <dir> -type l -ok rm {} \;
|
This command is dangerous. Use with care. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|