3
votes
6answers
157 views

ls content of a directory ignoring symlinks

I have a directory in which I would like to list all the content (files and sub directories) without showing the symbolic links. I am using GNU utilities on Linux. The ls version is 8.13. Example: ...
12
votes
2answers
437 views

How to define a symbolic link that I can use in all of my directories

Is it possible to write a symbolic link such that no matter where am I on the file system, I can use for example project to point the directory home/me/project? I would like to use commands like cd ...
0
votes
2answers
91 views

ln -s with a path relative to pwd

I'm trying to create a bunch of symbolic links, but I can't figure out why this is working ln -s /Users/niels/something/foo ~/bin/foo_link while this cd /Users/niels/something ln -s foo ...
2
votes
2answers
175 views

Symlink all subdirectories in a directory to another directory

I'm trying to symlink every directory in a folder to another folder. For example, in the structure below, I need the subfolders symlinked to folder2. - /home/chris/folder1 -- subfolder1 -- subfolder2 ...
4
votes
1answer
155 views

ls -l --group-directories-first (act on symlinks as well)

ls option --group-directories-first causes directories to be listed on the top, which makes the output of ls nice and clean: ls -l --group-directories-first However, it does not act on symlinks, ...
7
votes
3answers
111 views

How can I find out if a relative symlink is internal to a certain subtree or not?

I want to test if a relative symlink points within the subtree of a certain directory. This example would yield false since it points outside the foo directory: /foo>readlink bar ../fie.txt While ...
-1
votes
1answer
61 views

find not working right

if [[ "$1" == "" ]] then leftarray=($(find . -type l -printf "%p\n" 2>/dev/null)) rightarray=($(find . -type l -printf "%l\n" 2>/dev/null)) for var in "${rightarray[@]}" do ...
1
vote
1answer
89 views

Create Relative Symlink Inside Relative Symlink

I've been browsing for a minute now trying to find a way to create a relative symlink inside a relative symlink, and what I mean by that is this... I have my CakePHP Templates Skeleton as a symlink ...
4
votes
2answers
157 views

Force Bash 4 'globstar' option to ignore symlinks

Bash 4 has a fantastic option called 'globstar' that emulates (i.e. was stolen from) zsh's ** syntax for globbing across multiple directories. However, it's somewhat crippled (for my usage, at least) ...
4
votes
2answers
58 views

Is it possible to notify/warn that current path isn't a valid symlink anymore?

Let's say we have ./a and ./b directories. Then we create a symlink using ln -s a x and entering it cd x The pwd would be x Then in another terminal we change the x so that it pointed to b. But the ...
21
votes
2answers
1k views

Symbolic link recursion - what makes it “reset”?

I wrote a little bash script to see what happens when I keep following a symbolic link that points to the same directory. I was expecting it to either make a very long working directory, or to crash. ...
0
votes
1answer
316 views

Opera, Firefox has no kiosk option like Chrome gives it openly?

While using Chrome kiosk mode, i have problem with openbox desktop, its not doing correct for some javascript rendering. So i wanted to test opera and firefox but both does not support kiosk at all ...
5
votes
3answers
939 views

Create symbolic links to files using wildcards

I want to create symlinks to multiple files: ln -s dev-*.php 's/dev-(.*\.php)/$1/' Results hoped for: site.php links to dev-site.php file.php links to dev-file.php What's the most ...
3
votes
2answers
1k views

How could I make multiple symbolic links for multiple directories, conveniently

lrwxrwxrwx 1 deploy users 20 1월 23 18:15 v122 -> /home/files/video122 lrwxrwxrwx 1 deploy users 20 1월 23 18:15 v123 -> /home/files/video123 lrwxrwxrwx 1 deploy users 20 1월 23 ...
4
votes
1answer
197 views

How do I cd up and down again with symlinks in bash?

Structure: /base/ +- somedir/ +- symlink/ -> /some_other_dir This command (in addition to my Makefiles) fails: cd /base/symlink ls ../somedir Bash complains that ../somedir does not ...
12
votes
1answer
4k views

Make cd follow symbolic links

I have my code mounted as an sshfs in my home directory, but the hierarchy is difficult to remember, so I created a symlink in my home directory leading to that directory. Is there a way so that when ...
4
votes
0answers
153 views

Move a file and re-target all of its symlinks [duplicate]

Possible Duplicate: How can I “relink” a lot of broken symlinks? Is there any way to move a file to a new location, and then re-target its symlinks to the new location, using a shell ...
2
votes
1answer
490 views

Fix symbolic links after version change

Say I have a symbolic link to a file, which has its version in its name. (The file is actually a jar file) Now say, that the version changes, i.e the old file I linked to is deleted and a new one is ...
5
votes
1answer
421 views

Symbolic links with ls, mv: forcing the functions to utilize “logical” addresses (remembering the original path)

It seems that for many basic functions operating on symbolic links, the physical path is used by default. However, cd works fine. When moving into a symbolic link, cd remembers where I came from so it ...
3
votes
2answers
2k views

Use `ln` to create a missing directory

So I'm writing a small package manager, and a problem I've run into is making the symbolic links to files. It installs the package to /usr/pkg/name-version, and then reads a file to determine what ...
4
votes
2answers
2k views

What causes ln: //: Is a directory?

When linking a directory to root, I get this error: $ ln -s ~/inbox/ / $ ln: //: Is a directory Bash autocompletes the directory path by adding a /. I've tried escaping without success. $ ln -s ...
2
votes
2answers
736 views

Bash prompt when my home directory is a symbolic link

I symlinked my /host/Users/Kevin folder to /home/Kevin. I also edit the /etc/passwd file to /home/Kevin. I logged out and logged back in, however when I open up a terminal it's a bash prompt like so: ...
10
votes
4answers
4k views

symbolic link to a directory and relative path

I've created symlink with absolute path to the directory (Blink) and have for example following tree: $ ls -l /tmp/A total 0 lrwxrwxrwx 1 root root 6 Apr 3 12:27 Blink -> /tmp/B -rw-r--r-- 1 root ...
2
votes
1answer
2k views

Get path of current script when executed through a symlink

I have a utility consisting of a couple directories with some bash scripts and supporting files that will be deployed to several machines possibly in a different directory on each machine. The ...