All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
2answers
50 views

What sort of file thing do 'namespace files' point to?

I was poking around /proc/*/ns, and noticed that namespace files look unfamiliar: # example from `man namespaces` $ ls -l /proc/$$/ns total 0 lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 cgroup -> cgroup:[...
2
votes
1answer
74 views

Why can't I access a symlinked directory

I want to (soft)link my .thunderbird dir onto the actual directory which is on a SD card. Thus, (xenial)florian@localhost:~$ ls -la /var/host/media/removable/SD\ Card/.thunderbird/ total 24 drwx-----...
2
votes
0answers
66 views

Automatic symlink to latest folder

Is there a way in Linux to automatically maintain a symlink to the latest version of a file/folder in a certain location? My use case: I generate datasets with unique job names, then write them to a ...
0
votes
1answer
45 views

A command to know if some file are “only” an hard link and “not” a symlink [duplicate]

I need a command for an if condition to know if 'file_name' is an hard link (not symlink). Thanks
21
votes
6answers
12k 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 ...
51
votes
5answers
64k views

Determining if a file is a hard link or symbolic link?

I'm creating a shell script that would take a filename/path to a file and determine if the file is a symbolic link or a hard link. The only thing is, I don't know how to see if they are a hard link. ...
3
votes
1answer
158 views

Some special files in Unix

Background There are lots types of special files in Unix, for example symlinks, device files and proc files (under /proc). /proc files are just normal files or even text files. But for the rest, I ...
2
votes
0answers
79 views

AIX : NOFOLLOW_LINKS is not supported on this platform

I have an AIX 7.2 machine. I am trying to run a Java program on it. It gives me this error: NOFOLLOW_LINKS is not supported on this platform. It is because I am using this call in the program: Files....
2
votes
0answers
56 views

Given a pathname and a symlink to a directory in the pathname, is there a command which can return an equivalent pathname making use of the symlink?

Sometimes I have a long pathname, and want to shorten it by some precreated symlink to a directory in the pathname. Specifically, given a pathname /path/to/file, and a symbolic link /symlink to a ...
4
votes
1answer
67 views

Can we create soft links that concatenate multiple files? [duplicate]

Let's say that I have files f1, ..., f9. I want to create a single view -- or a soft link -- say f, that displays a concatenated view over the 9 files. For example, if I execute wc -l f the answer ...
1
vote
4answers
581 views

thoroughly find all links (hard and symlinks, and any combination thereof) leading to a file/dir [duplicate]

I want, only using "basic" commands (for maximum portability) (i.e., something that would work on AIX / Linux / etc., not just something using a recent nicety ^^), to find all the files (symlinks, ...
2
votes
1answer
1k views

How to zip directory excluding symbolic links and the files they point to?

I have a directory with files, subdirectories and symlinks How to zip only files and folders from that directory without symlinks or files referred to by the symlink?
-2
votes
1answer
100 views

creating test1 and test2 files in /var directory in Linux, [closed]

I need to create test1 and test2 files in /var directory in Linux , and creating Hard link for test1 file and soft link for test2 file in /tmp
1
vote
2answers
8k views

ls shows a directory but it is inaccessible

I was trying to copy one folder from one location to another. The folder is about 6.4 Gb. So I did cp -r source_folder level1/val after that, I went into the level1 folder and checked: level1$ ...
4
votes
2answers
3k views

Convert a hardlink into a symbolic link

It is easy to convert a symlink into a hardlink with ln -f (example) It would also be easy to convert a hardlink (filenames link and original) back to a symbolic link to link->original in the case ...
107
votes
1answer
174k views

How to change where a symlink points [duplicate]

Can you tell me what this is in the area marked red? If I want to change /media/files/tb-prod/files to some other path, how would I do that?
0
votes
0answers
71 views

Binary representation of Symbolic Link

I am working on a ctf and I want to upload a Symbolic Link that points to a file instead of uploading a regular file. I want to know if there is there a way to build a symlink by hand or to copy the ...
31
votes
6answers
7k views

Replace file with hard link to /dev/null

I'm running an application that writes to log.txt. The app was updated to a new version, making the supported plugins no longer compatible. It forces an enormous amount of errors into log.txt and does ...
2
votes
3answers
224 views

Switch symlink and directory

I have a directory and a symlink to it: mkdir dir ln -s dir dir_symlink I want to replace the symlink with the directory and the directory with the symlink. Is there a way to do that atomically (or ...
1
vote
1answer
248 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 ##################...
7
votes
2answers
539 views

How to use ls to group directory symlinks with other directories?

ls --group-directories-first displays all directories before files, but if there is a symlink to a directory, it is displayed among the files. Is there a way to group directory-symlinks with other ...
2
votes
1answer
2k views

Creating a copy of a file, that gets automatically updated

I'm using Fedora 26. I want a script to run at startup, but also have this script in my scripts folder. How can I make it so the /etc/init.d/foo gets updated when I edit ~/scripts/bar? I was thinking ...
13
votes
2answers
11k views

Why do hard links seem to take the same space as the originals?

Thanks to some good Q&A around here and this page, I now understand links. I see hard links refer the same inode by a different name, and copies are different "nodes, with different names. Plus ...
15
votes
2answers
6k views

How to replace a symbolic link with a copy of a file it links to?

Having a (single, no batch filesystem processing needed) symlink, what a command line to use to replace it with a copy of the file it links to?
2
votes
1answer
216 views

Why symbolic links have no data blocks allocated to them in ext4fs?

I am a Unix wanderer. I just noticed that symlinks don't have data blocks allocated to them, I think the inode of the symlink file stores the filename which the symlink refers to, is this actually the ...
6
votes
1answer
3k views

What exactly files whose names' prefix is “AT.postflight.” are needed for?

I am not sure if this question should be asked here, since I am on an OS X, but since I am using bash, and I am asking about the meaning and the purposes of some files. I am trying to understand why ...
17
votes
1answer
3k views

ls -l vs ls -lL

I know this looks like a duplicate, but previously asked questions do not answer my question so in the shell I go to /home directory and create a directory there calling it play then I go to this ...
0
votes
1answer
32 views

Why soft links from standard folders?

My observation is, most of the python files sitting in some standard locations like site-packages are symbolic links to actual file name(sitting in non-standard folder) pointing to inode. ...
1
vote
1answer
149 views

How to create a POSIX-compliant relative symbolic link in /bin/sh?

The idea is to have the environment configured like this: mkdir ~/shortcuts cd shortcuts ln -s ../.. up2 As a result I want to be able to go 2 directories up the file tree whenever I call: ~/dev/...
36
votes
8answers
6k views

What is the difference between a hard link and a file?

A hard link is defined as a pointer to an inode. A soft link, also known as a symbolic link, is defined as an independent file pointing to another link without the restrictions of hard links. What is ...
2
votes
1answer
280 views

Find of symbolic links point to the same target [duplicate]

How can I find all of the symbolic links in a directory, that point to the same target? For example, here is a list files in a directory: a.txt b.txt a -> target1 c -> target1 m -> target2 ...
6
votes
2answers
1k views

Find incoming symlinks [duplicate]

In Linux, what is the best way to find all symbolic links that point to a given file (regardless of whether the symlink is relative or absolute)? I realize this will require scanning the whole ...
1
vote
2answers
308 views

Is there a light-weight file system that implements symlinks and file permissions on top of another file system that does not support those?

I am using some cloud storage services (like Dropbox, MEGA, Amazon Cloud Drive, etc). Most of these do not support symlinks and file permissions (simple read/write/execute permissions for user, group, ...
6
votes
2answers
541 views

How to unlink file symlinked to itself without destroying

I'm not sure how this happened, but I have a number of files that have becomed symlinked to themselves. It seems likely that there won't be any way to restore the files, but hopefully there is. Here ...
4
votes
1answer
3k views

read only symlink or something similar? [duplicate]

I created myself a NAT for home use (Ubuntu+Samba+Greyhole+Apache+MySQL+other web server related stuff). 90% of files I store there are pictures that i really don't want to lose (that's why Greyhole). ...
1
vote
1answer
343 views

Is it possible to download from link file from a web directory?

Suppose there is an instance of apache whose web directory is: /var/www/html Is it possible to create a link from a file in a distinct directory so that a web user can download that file using the ...
4
votes
1answer
6k views

accessing path from outside the root with symlink

I need to add an outside path to my apache configuration. (httpd) so, I made a symlink to this path in my httpd root folder, the path is: /var/log/httpd/ (I want to display logs directly in my ...
5
votes
1answer
1k views

Where is information about hard/soft links stored?

Where does the *nix system store information about number of hard links to a specific inode? I can't find any information about that. Everywhere what a hard link is but rarely a bit more advanced ...
2
votes
2answers
129 views

Something like a symbolically linked file, but with change details attached?

Is there a file type or method for using files in which certain files look and behave like symbolically linked files, but contain extra meta information for changing the data when they are read? ...
2
votes
2answers
5k views

How do I dereference links when extracting from a tar file?

If I have a tar file, bob.tar, which contains real_file and link_to_real_file, in which the latter is a symlink, is there a way to extract the contents of bob.tar so that link_to_real_file will not be ...
0
votes
1answer
67 views

File -> ../../archive/folder/file restore

Hi i'm new to Linux and I need to use it temporary to set up LetsEncrypt. Once complete, I needed to move the /etc/letsencrypt/live/fullchain.pem file into the root dir but i moved the file incorectly:...
1
vote
1answer
216 views

Symlink to same directory

I've set up a ftp server for using ftp push on a tv recording page. I've created an extra user for this, who has only access to one directory, which the user is chroot-ed in. But the page does not ...
0
votes
2answers
53 views

Is there a method to make Multipart or Virtual Files?

Is there a method of creating a symbolic file that refers to the contents of a directory? So for example, calling: cat all_keys would give the same output as: cat keys/key1+keys/key2+etc... I've ...
0
votes
1answer
5k views

file with permission lrwxrwxrwx does not show any link on “ls -l” command

lrwxrwxrwx. 1 tomcat tomcat 27 Oct 17 00:23 work This is my file(link) I want to go inside a directory within it to rm a file and then copy the new one. But it says permission denied and does not ...
10
votes
2answers
19k views

tar command - skip symlinks

I use the tar command as, tar -cvf protTests.tar protTests/* to tar all files inside the folder, protTests. But this is including the symbolic links inside the folder, which is not a desired one. ...
1
vote
1answer
306 views

Creating an symbolic link in /bin automatically creates a second link in /usr/bin and the which command chooses /usr/bin

I just created an executable: ln -s /path/to/script.sh /bin/script then I check if everything succeeds and it does(/bin/script is created) but this has also created: /usr/bin/script and if I check ...
1
vote
1answer
102 views

Map Home to External Drive

Whereas I have my OS (in this case, Elementary OS Freya) installed on my non-partitioned internal hard drive, I have an external hard drive with /Documents, /Downloads, /Movies etc. where I store all ...
3
votes
2answers
159 views

List direct symbolic links (links that don't point to another symlink)

I need to make a list of all direct symbolic links in a directory, i.e. symbolic links that point to another file which is not a symbolic link. I tried to do it this way: for i in $(ls -1A); do ...
9
votes
2answers
1k views

How can I list files of which no symlinks exist?

I have a large "myfiles"directory full of miscellanous documents and do not want to modify its structure. I therefore created (several) other directories for each class of documents. For example I ...
2
votes
1answer
2k views

Creating symlinks in the etc directory without root access

What I would like to create if I had root access would be a symlink from some file or folder in the /etc to another file or folder in the /etc. However, I do not have root access. Is there any way to ...