All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
1answer
63 views

/bin/sh symbolic link not working properly

I am using i3, and by default, it uses sh when starting process with the i3 config exec command. This is fine and dandy, but that means the environmental variables created in my .zshrc do not get ...
1
vote
1answer
76 views

“ls -l” doesn't show symlinks source paths

Before I reinstalled MacOS, ls -l showed symlinks with their source path. Now ls -l shows symlinks as regular files - without the source path. How can I make it show the source path? I'm on a clean ...
0
votes
2answers
36 views

How to change relative symlinked path to “actual” one (in ranger or terminal)

What is actual path? Consider folder A in the file system and a symlinked B to it. Consider currently in ranger (or terminal) inside a sub-directory within B such as /home/B/sub1/sub2 which is in fact ...
0
votes
1answer
8k views

“No such file or directory” error on existing file?

I have an issue with a binary(?) that simultaneously seems to exist and not exist. $ ls -l /usr/local/bin/vue lrwxr-xr-x 1 myusername admin 73 Jul 14 15:31 /usr/local/bin/vue -> ../../../Users/...
0
votes
2answers
453 views

Symlinking all dot-files and -directories

Say I have a folder ~/dot containing some files and directories, such as zshrc, Xresources, and emacs.d. How do I create symlinks to all of those in ~, but such that the symlinks begin with a dot (....
1
vote
1answer
108 views

Source control and symlink for .zhistory

I symlink dot files from my home directory to actual files in a separate folder that is under git source control. This works great, but for some reason I am having problems with .zhistory. $ echo $...
6
votes
1answer
153 views

Looking for tested utility to get the absolute path to a relative symlink target

NB: In the original title of this post, I used the word standard in the everyday sense of "well-established" (and therefore time-tested, as a contrast to quick solutions I could roll myself). In the ...
0
votes
1answer
441 views

Directory link works inside of path, permission denied in home folder or other locations

On MacOS 10.12.1 I have an issue with symlink permissions I have created a link that is in my $PATH lrwxr-xr-x 1 <redacteduser> staff 48 Dec 14 13:23 <redactedlink> -> /users/&...
0
votes
4answers
2k views

Show contents of symbolic link

In zsh, I make a symbolic link $ ln -s ~/Documents symboliclink and then I want to know what's inside this symbolic link. $ ls -l symboliclink > lrwxrwxrwx 1 user user 21 Oct 10 15:56 ...
1
vote
1answer
155 views

Git tracking dotfiles that are symlinked

I keep my dotfiles in a private git repo on bitbucket and this works great for the majority of my files (.vimrc, .tmux.conf etc) then I just set up symlinks from my home directory to my cloned gitrepo ...
2
votes
2answers
402 views

ls .. doesn't work properly with symlinks

I have directories set up a bit like this ~/code ~/code/src ~/code/build -> /path/to/somewhere/else That last one's a symlink. If I do this cd ~/code/build ls .. then I get the listing for /...
9
votes
1answer
3k 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, ...
2
votes
2answers
212 views

Capturing the name of the file pointed by a symbolic link in a variable

Say I have a symbolic link: /path/to/foo->/path/to/some_file.txt Say I have a shell variable x=/path/to/foo, how can I get some_file.txt in a shell variable y?
5
votes
3answers
1k 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) ...
20
votes
6answers
11k views

Getting relative links between two paths

Say I have two paths: <source_path> and <target_path>. I would like my shell (zsh) to automatically find out if there is a way to represent <target_path> from <source_path> as ...
7
votes
3answers
4k views

cd to directory of a symbolically linked file

Before I write a script, anyone know an easy way to do the following: $ pwd /foo/bar $ ls -l lrwxr-xr-x 1 username admin 48 Apr 17 2012 foo.sh -> /bar/foo.sh $ cd /bar $ ls foo.sh i.e., in ...
27
votes
7answers
17k views

Portable way to get script's absolute path?

What is a portable way for a (zsh) script to determine its absolute path? On Linux I use something like mypath=$(readlink -f $0) ...but this is not portable. (E.g., readlink on darwin does not ...