1
vote
1answer
16 views

Trouble creating real NTFS links using Cygwin

I have administrator privileges and would like Cygwin's ln -s to make NTFS links instead of the fake !<symlink> files that only Cygwin understands. I tried the following, based on Cygwin ...
0
votes
1answer
61 views

how to change directory in ubuntu

I'm trying to change the directories of a symbolic link. ln -s /usr/local/mysql-cluster-gpl-7.1.5-linux-i686-glibc23 /usr/local/mysql When I type command cd /usr/local/mysql it is giving me error ...
0
votes
3answers
142 views

CentOS - how to use ln command in this situation?

Create a file like the log file in CentOS, when this log file is updated, then the copy of the log file is also updated. Maybe I use this command: ln -s logfile copy_of_logfile Then when logfile's ...
1
vote
0answers
57 views

Running a symlink locally

I am running the same program multiple times over a linux platform. It is compiled at another server, and frequently updated, and it's uploaded over through rsync to all "hosting" servers, which do ...
1
vote
2answers
2k views

How to create symbolic links to all files (class of files) in a directory?

I would like to create symbolic links (ln -s) to all files (or a class of files, e.g. ending with .bar) in a certain directory. Say I'm in the cwd and type ls ../source/*.bar gives me foo.bar ...
4
votes
1answer
670 views

How to properly create symbolic link?

scenario : I'm in a place that is not in PATH I have a file name dofoo that is executable I want to create symbolic link in /usr/bin that points to dofoo in current directory quite hard to get the ...
2
votes
2answers
94 views

Symlink bash autocomplete

If I typer unrar-nonfree and double tap tab, I get the usual autocomplete result: michaelxu@michaelxu-server:~$ unrar-free / backup.sh initrd.img.old mxx.lock tmp/ bin/ ...
1
vote
1answer
103 views

Windows SymLink Questions: How do I tell if a file is symlinked /

I'm not exactely sure how to phrase my questions, I'll describe what I'm doing, perhaps my misconceptions will show. I'm on windows 7. I symlinked files that I'm working on in a project to a sandbox ...
5
votes
1answer
427 views

Convert symlinks to hard links

I'd like to recursively convert soft links to hard links in a directory. I've tried something like this: for f in *; do (mv $f{,~} && ln $(readlink $f~) && rm $f~) done …but it ...
1
vote
1answer
773 views

Convert Linux symlinks to Windows symlinks

I've noticed that Linux symlinks don't work in Windows, and vice-versa. Is there any way to convert Linux symlinks to Windows symlinks? Specifically, I want to convert relative Linux symlinks to ...
0
votes
3answers
4k views

Why doesn't my symbolic link work?

I'm trying to better understand symbolic links... and not having very much luck. This is my actual shell output with username/host changed: username@host:~$ mkdir actual username@host:~$ mkdir proper ...
1
vote
1answer
513 views

Symlink path can be followed manually, but `cd` returns Permission denied

I am trying to access the directory /usr/software/test/agnostic. There are several symlinks involved in this path. As you can see by the below transcript, I am unable to cd directly to the path, but I ...
1
vote
1answer
2k views

Unix Copy (cp) without Symbolic Links

I want to copy my files but convert the symbolic links to hard links (ie. the actual file). How can I do this? Here's my code (that isn't working): cp -RL ${FROM_DIR} ${TO_DIR} Note: this is for ...
1
vote
1answer
120 views

Unix (Debian) autocomplete paths thru symlinks

By default, directory symlinks on unix systems are treated as files as far as the autocomplete feature goes. For example, having a directory symlink at /srv/link/, typing /srv/liTAB does only complete ...
5
votes
2answers
2k views

Symlink to current folder as absolute path without typing whole path

Symlinks are saved shortcuts for relative paths: ~/foo➤ ln -s . ~/bar/foo ~/foo➤ ls -l ~/bar total 8 lrwxr-xr-x 1 me me 1B 15 May 14:38 foo -> . The file ~/bar/foo is a symlink to bars ...
1
vote
1answer
402 views

Make Bash's PS1 show original directory name and not symlink?

I currently have PS1='\W' but when in a symbolic link'd directory, the prompt shows the symlink name, how can I make PS1 to show the original directory name?
2
votes
1answer
466 views

Generate a list of files by piping output of find command into another find command?

I need to generate a list of files for use in a shell script. The list should be all files (in a specified directory) that are hardlinked. I want to replace the hardlinks with symlinks. (Obviously, ...
0
votes
1answer
251 views

How to improve this bash shell script for turning hardlinks into symlinks?

This shell script is mostly the work of other people. It has gone through several iterations, and I have tweaked it slightly while also trying to fully understand how it works. I think I understand it ...
20
votes
3answers
8k views

Does rm -f follow symbolic links?

I have a directory like this: $ ls -l total 899166 drwxr-xr-x 12 me scicomp 324 Jan 24 13:47 data -rw-r--r-- 1 me scicomp 84188 Jan 24 13:47 lod-thin-1.000000-0.010000-0.030000.rda ...
1
vote
2answers
2k views

How get full path to target of link

If I have a symbolic link /var/opt/foo created with ln -fs /path/to/target/dir foo. How can I in a script that sees only the link get /path/to/target/dir? What I want to achieve in the script is rm ...
3
votes
1answer
114 views

Find symlink when 'find' hasn't worked

So I have a few utility scripts in my ~/scripts folder. They are all bash scripts, nothing amazing about that. One is named sfind.sh, the other is svn-add-all.sh. At some point, I created symlinks to ...
2
votes
2answers
284 views

shell utility to check if directory is an ancestor to a file

How can I check that a given regular file of path f is a descendant of a directory of path d. If not for symlinks, I would just check if d (with a trailing slash) is prefix to f. Now with symlinks ...
8
votes
2answers
1k views

Tab-completion with directories/links

I have this problem with tab-completion in terminal in both archlinux and ubuntu: I have a link which links to a directory named "something" in my home directory. Now when I open a terminal and want ...
2
votes
1answer
598 views

Are my Linux symbolic links acting correctly?

I've been using Linux on and off for the last 15 years and today I came across something in bash that surprised me. Setup the following directory structure: $ cd /tmp $ mkdir /tmp/symlinktest $ ...
5
votes
3answers
8k views

How can I break a symbolic link loop?

While I was trying to compile a C shared object library, I accidentally created two symbolic links which point to each other. Is there a way to get rid of them without nuking the whole directory? I ...
9
votes
2answers
6k views

Finding all symbolic and hard links to a file on UNIX

If I have a specific file in a UNIX filesystem, is there a way to use bash to find all links to that file, both symbolic and hard? If I need different commands for each, what are they?
6
votes
2answers
23k views

How to find all soft links (symbolic links) in current directory?

Question relates to shell-scripting in bash. How to check with a script which files within the current directory are soft links? In case I have used the wrong term, when I say soft links, I am ...
75
votes
5answers
72k views

chown is not changing symbolic link

I'm trying to change the user/group of a symbolic link with the command: $ chown -h myuser:mygroup mysymbolic/ But it's not changing. I'm logged in as root. The current user/group is set to ...
6
votes
4answers
3k views

Need to hide a symbolic link without hiding the directory it links to

I created a symbolic link (specifically a symbolic link & not a Finder alias which bash can't follow) to a directory in my home folder using ln -s link $HOME/directory & now I wish to hide the ...
44
votes
4answers
75k views

How to remove a symbolic link to a directory?

I made a symbolic link with the following commmand: ln -s ../test5 I want to remove it now but my rm fails: $ rm -Rf test5/ rm: cannot remove `test5/': Not a directory $ rm test5/ rm: cannot ...