All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
0answers
32 views

How to list the contents of a directory using a symbolic link?

I'm trying to figure out how to list the contents of a directory using a symbolic link to that directory. I read the answers here - Show contents of symbolic link The problem I'm having is just that ...
0
votes
3answers
38 views

Uncertainty with Symlinks

I've done a quick search but I can't find anything specific about this scenario: Let's say I have a directory (let's ignore the path) and call it A. Now, I create a symlink to directory A called S. ...
0
votes
2answers
71 views

Is it possible to “add” a second folder to the current folder file contents? symlink?

question: Is it possible to "add" the contents of a 2nd folder to the current folder file contents? (In essence I was asking from a full Unix is perspective but may be nginx would work too as the goal ...
3
votes
1answer
406 views

Permission denied when cd to symlink'd dir in /tmp that is 700 and owned by regular user

Question: Why am I not able to cd into a symlinked directory with 700 permissions, owned by a regular user, as root, when I am able to change into the directory itself? Example: ttucker@plato:/tmp# ...
1
vote
1answer
306 views

Move directory structure and preserve symlinks [duplicate]

I'm trying to work around a makefile issue where libraries are installed in the wrong place. Someone else wrote the makefile and it is not easy to fix. I'm trying to move the libraries after they have ...
0
votes
3answers
40 views

Is working in symlink directory identical to working in the directory directly? [duplicate]

In my home directory, I have a folder named symlinks in which all my symlinks live. I've added this folder to my CDPATH, so that I can do: ~$ cd FarAwayDirectory ~/symlinks/FarAwayDirectory$ I’ve ...
0
votes
1answer
130 views

Link hidden directories

I would like to completely link /root/.vidoes/ to the new directory /home/videos/ If a script tries to read/update/save a file to /root/.vidoes/ for example /root/.vidoes/newvideo.mp4 then it should ...
0
votes
1answer
323 views

Why does `rm` claim my symlink is a directory? [duplicate]

I made a symlink to a directory like this: ln -s /some/directory symlink Now I'd like to remove the symlink: rm symlink/ This doesn't work. The error message is: rm: cannot remove 'symlink/': Is ...
1
vote
1answer
282 views

How to symlink files in folders

Iterate over files in folder and creating symlinks: I have the current script that is trying to iterate over files in a folder, and create symlinks into another folder: #!/bin/bash ##################...
2
votes
2answers
94 views

Faking a directory path without the full path existing

I'm working with a build system that relies on absolute paths to reference source files etc. When I want to test building with different toolchains, I mount the src directory in VMs or chroots. The ...
0
votes
1answer
366 views

How to chdir to symlink source and not target in .screenrc

Is there a way to tell screen not to dereference symlinks when one is passed to the chdir command? In my .screenrc I have commands like this: chdir /data/project1 screen -t "project1" chdir /data/...
2
votes
2answers
209 views

Why can a softlink to a directory be created with or without the trailing slash?

I have found that when creating a symbolic link to a folder it is produced with or without the trailing slash based on your input. for example: $ ln -sfv /ln-test/FOLDER/ test-tail test-tail -> /...
2
votes
1answer
43 views

How to link to original dir by linking a link to that dir?

Here is the sample $ mkdir original_dir $ ln -s original_dir link $ ls -l original_dir link -> original_dir Now I want to create a new link to original_dir by linking to link, how can I do that $...
14
votes
1answer
3k views

What exactly is dot dot (..)? Why is its behavior different with symlinks?

I am trying to understand the nature of .. (double dot). It seems to point to different targets depending on how you access it. Example:- /outer/ middle/ inner/ inner ...
1
vote
2answers
720 views

Ignore directories under a certain root while following symlinks with find

I am collecting all the files under a directory. But this directory has symlinks to other directory outside of the directory where I am running the find command and it contains huge number of files as ...
1
vote
0answers
135 views

Symlinks created but not “there” SSH

I am creating Symlinks for Magento purposes but for some reason something is going wrong. I created the symlinks using PuTTy SSH. So I did this: cd /home/user/domains/newwebsite/public_html/ ln -s /...
1
vote
1answer
2k views

Can I replace a directory with a symlink without write permissions in parent?

I would like to replace a directory with a symlink. For the directory itself I have full permissions (rwx), but for the parent directory I don't have write permissions (r-x). Is this possible? The ...
1
vote
2answers
97 views

How to work with symbolic links to directories

I am experimenting with symbolic links and I'm encountering a couple issues. The first is how after following a symbolic link to a directory to display the actual working directory instead of the ...
2
votes
2answers
3k views

How to redirect file output to a different directory?

I have a program that regularly outputs files to a directory, let's say /a/b. I am utterly unable to change where these files are outputted. But for me to use them, I must first move them to, let's ...
1
vote
0answers
182 views

Bash tab completion not working within symlinked directory

I'm working with Bash 4.2.46 on RHEL7 with the bash-completion packages installed, but I seem to have found an odd corner case where tab completion doesn't seem to work as expected. I have a set of ...
2
votes
2answers
557 views

difference between /dir and /dir/ [duplicate]

Consider a symlink I am making to my Music directory named music. ln -s Music music now consider following sequence of commands: edward@ArchLinux:~$ readlink music Music edward@ArchLinux:~$ ...
0
votes
2answers
124 views

Does soft linking a directory hard link its subfiles?

Suppose I have the following configuration: Folder A file1 file2 I then create a soft link of Folder A as follows: ln -s A B so that we now have: Folder A file1 file2 Folder B ( symlink of ...
3
votes
1answer
216 views

How can you group symlinks with directories in `ls` output but tell the difference?

In ls output, I'd like to group symlinks that point to directories along with the rest of the directories, but still have a way of telling that it's a symlink either with color or an appended symbol. ...
2
votes
2answers
7k views

Is it possible to create a virtual directory in Linux?

Like this way in Windows mklink /D Virtual_Folder_Here Real_Folder_Here. I was unable make work alias in Apache virtual sites in Windows so I made a virtual directory. Is this possible in Linux too?
1
vote
1answer
46 views

Creation of symlinks

I am following the tutorial http://www.olindata.com/blog/2013/12/building-ha-cluster-openvz-drbd-heartbeat-and-pacemaker. I got up to here: symlink folders in /var/lib/vz to /etc/vz The /etc/vz has ...
1
vote
1answer
91 views

Strangeness with Symlinks and Relative Paths

Could someone please explain this to me? I'm having trouble understanding how this is set up and why it behaves the way it does. I wanted to see where zsh is actually installed on a machine that I ...
6
votes
3answers
6k views

list all symbolic links to valid directories only with find

I can use find /search/location -type l to list all symbolic links inside /search/location. How do I limit the output of find to symbolic links that refer to a valid directory, and exclude both, ...
8
votes
1answer
2k views

Understanding directory symlinks traversals and the parent directory

Let's say you have directories /dir1 and /dir2/linked, where the latter is a symlink to the former. When you cd to linked and pwd, you get the output /dir2/linked. If you then cd .., you'll be put ...
9
votes
3answers
6k views

Symlink aliasing files in subdirectories without changing current directory

It seems like it should be simple to symlink one file to a new file in a subdirectory.... ....without moving subdirectories. But something about the syntax is perplexing and counter to what I would ...
2
votes
2answers
339 views

ls doesn't give me the same as cd + ls to the same folder

$> ls ../../../../.. Doesn't give me the same result as $> cd ../../../../.. $> ls Why? Something with links? What's going on? [ johanrj@jamin ] ~/XXX/broadcom/asuswrt/release/src-rt-6.x/...
2
votes
2answers
66 views

Understanding and using Symlinks

I have a bit of a situation with a virtual server running some RHEL distro. The server is hosted on a Win2008 server via VMPlayer When it was created the initial partitions were set incorrectly. /...
2
votes
2answers
442 views

Folder alias / Symbolic link to return to back folder

I need to create a folder "2015" which re-routes to ./ but I don't know what the command is. Not sure if the term is called in this case an alias (or symbolic link). So I need to make the same "re-...
2
votes
1answer
245 views

When is a symlink treated as the thing it links to, and as a symlink?

When is a symlink treated as the thing it links to, and as a symlink? A symlink can links to a file of different types. For example, let mylk be a symlink which links to a dir. The following two ...
7
votes
1answer
359 views

cd and ls behave differently when inside a softlink to a dir

When we cd into a dir via its softlink, i observe: ls .. will show the content of the parent dir of the linked dir, while cd .. will go under the parent dir of the softlink. Why are they different? ...
0
votes
1answer
58 views

“Links” to dirs that have features of both hard and soft links?

It is not allowed to create a hard link for a dir. But the soft like will not work, if I later change the name of the dir. How would you solve the dilemma? Are there applications which can make ...
7
votes
3answers
13k 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 ...
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, ...
4
votes
3answers
530 views

Why can't I edit links and directories directly?

There are programs such as hexedit that allow one to edit each bit of a file, and as I keep hearing that in Unix "everything is a file", I tried to edit some directory, expecting bytes referring to ...
3
votes
1answer
535 views

Test for link with trailing slash?

I created in /tmp/test/ mkdir somedir ln -s somedir/ somelink I want to loop through only directories: for file in */ ; do if [[ -d "$file" && ! -L "$file" ]]; then echo "$file is a ...
3
votes
2answers
228 views

Is there a way to condense ../.. parts of a path out programmatically?

Say for example I have these types of paths to files in a script: /path/to/some/file/../../file1.txt Is there a command I can call such as readlink that will convert this path to its actual physical ...
110
votes
4answers
461k views

Create a symbolic link relative to the current directory

I'm trying to create a symbolic link in my home directory that points to a directory on my external HDD. It works fine when I specify it like this: cd ~ ln -s /run/media/name/exhdd/Data/ Data ...
2
votes
3answers
561 views

What has happened to the file when I entered “mv file.txt ../”?

I wanted to move 'file.txt' one folder up, but instead of mv file.txt ../file.txt I entered mv file.txt ../. Now the file is gone and I didn't get any error message. So it seems the some action was ...
7
votes
1answer
35k views

Remove soft link but not the target

I have a directory that contains a link to another directory that I just created. I would like to remove the link but preserve the directory my link was pointing to. How do I do this? > mkdir rgac ...
7
votes
1answer
9k views

Can we use symbolic link and hard link for directories?

I know we can do that for files. What about directories? It seems that cpanel uses that a lot.
0
votes
1answer
736 views

pwd resolving symbolic links [duplicate]

Possible Duplicate: pwd without symlinks Imagine I have a directory /home/me/dir and a symbolic link to it called /home/me/dirlink now if I enter dirlink and use pwd, it of course prints the ...
3
votes
2answers
1k views

Why is bash giving me (apparently) conflicting information about a file?

Background I am working on a RHEL 5 cluster. I want my Fortran program to read the file /home/bob/inputs/input_1 I asked Bob to give me permission to read all contents of inputs: [bob@server]$ ...
4
votes
2answers
103 views

Quicker Way to Reference a Directory?

This one is probably easy for all of you, but I have never had to deal with such a nested local set of directories. If I have a path like: /mnt/media2/Archived\ Files/_Transfer/ is there a way to "...
3
votes
2answers
496 views

open a file using CDPATH and symlink

To quickly move around, I added a path to CDPATH that contains symlinks to different locations. I did this by adding the following line to .bashrc: export CDPATH=~/symlinks When working with ...
1
vote
1answer
722 views

How does apache determine what directory to show from public_html?

I am using Ubuntu 12.04 and have configured apache to serve from ~/public_html. I am trying to serve some directory contents over http on LAN. When I did the following: ln -s ../Videos/android-...
5
votes
2answers
13k 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 ~/...