Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
3 answers
303 views
/bin, /sbin symlinks mysteriously breaking, init file disappearing. How to debug?
Similar to [here][1], but no solution was found for them either. I also tried checking the history, see if something was running 'rm' but no dice. Periodically, my device stops responding. The *only* commands I can use are builtin shell commands such as cd, echo, pwd. Any other command such as ls (b...
Similar to here , but no solution was found for them either. I also tried checking the history, see if something was running 'rm' but no dice. Periodically, my device stops responding. The *only* commands I can use are builtin shell commands such as cd, echo, pwd. Any other command such as ls (bin) or fsck (sbin)... all show -bash: /usr/bin/ls: no such file or directory, yet the files still exist. If I cd into /usr/bin and run echo *, I see a list of all the commands that supposedly cannot be found. ls, sudo, ect... , but I cannot execute them. Attempting to manually execute /usr/bin/ls results in the same error. I checked my path variable... it seemed fine echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin The only files I noticed missing were usr/bin/init and usr/sbin/init (thus prompting the boot to initramfs on restart). Additionally, under root / the /bin and /sbin folders were *gone*, possibly the symlinks were missing? On a working install, there is a symlink between /bin -> /usr/bin When this occurs, since I have no permissions, and nothing else works, I am forced to restart by powering off/on the machine, followed by it booting to initramfs. I know a temporary fix to the the issue... From an USB with a fresh install of my distribution, I copy over /bin, /sbin, /lib to my boot partition under /root. But this doesn't solve it permanently, and the issue comes back after a while. I would really appreciate any help, I'm honestly completely lost as to what to do now. I have tried... *1. fsck the partitions.* Both my boot partition (mmcblk0p1) & root partition (mmcblk0p2) seem fine. Dirty bit was set on boot partition 0p1, likely due to hard poweroff. 2nd pass determined no issues. *2. badblocks* found 0 bad blocks in its read test *3. Memtest the device* I haven't been able to memtest it yet, as I cannot figure out how to get my device to boot to it. I flashed memtest to an SD card, as well as a usb. My device won't boot from either. I don't have a bios, it's running u-boot. Supposedly, I can interrupt the u-boot process to select where to boot, but pressing keys does nothing during boot. Someone here suggests it may be that there isn't USB support for the keyboard in u-boot, only once it boots to linux... making it impossible to boot from another drive? The device is an Orange Pi 5B, with Ubuntu 22.04 flashed to the EMMC drive built onto the device. *4. Test the PSU* I am running with this 5v 4a PSU, people Here seem to have similar issues. How can I test if my PSU is the issue, or if nothing else, can someone suggest one that wont have problems, so I can rule the PSU issue out?
MadAtTheKeyboard (1 rep)
Nov 4, 2024, 09:37 AM • Last activity: Aug 5, 2025, 05:30 AM
0 votes
1 answers
2411 views
How to create a symlink the desktop way in debian Xfce?
The method of using ctrl + shift and clicking on the item in the file manager does not work. Is there another method to achieve the creation of a symlink from the desktop? thanks for any hint
The method of using ctrl + shift and clicking on the item in the file manager does not work. Is there another method to achieve the creation of a symlink from the desktop? thanks for any hint
HoCo_ (111 rep)
Jul 22, 2019, 05:19 AM • Last activity: Jul 13, 2025, 05:01 PM
1 votes
1 answers
2219 views
Git - how to add/link subfolders into one git-repository directory
Assuming I have a file structure like this: ├── Project-1/ │   ├── files/ │   └── special-files/ ├── Project-2/ │   ├── files/ │   └── special-files/ └── Project-3/ ├── files/ └── special-files/ Now I want to create a Git repository, including all the `special...
Assuming I have a file structure like this: ├── Project-1/ │   ├── files/ │   └── special-files/ ├── Project-2/ │   ├── files/ │   └── special-files/ └── Project-3/ ├── files/ └── special-files/ Now I want to create a Git repository, including all the special-files folders. If it was files, I could create a hardlink ln ./Project-1/special-files ./Git-Project/special-files-1 and so on, so I would get: Git-Project/ ├── .git ├── .gitignore ├── special-files-1/ ├── special-files-2/ └── special-files-3/ Though hardlinks do not work with folders. Symlinks do not get handled by git. **Is there a way to achieve, collecting/linking these folders into a git repository-folder?**
nath (6094 rep)
Aug 5, 2021, 04:48 PM • Last activity: Jul 7, 2025, 01:01 PM
2 votes
2 answers
138 views
Tar cannot create symlinks on extraction
The command run to un-archive is as follows: `tar -zxvpf my_files_weekly.tar.gz --exclude=/etc/ssh/ -C / > /dev/null` Results in the following errors: tar: ./usr/share/doc/udev: Cannot create symlink to ‘libudev0’: File exists tar: ./usr/share/doc/perl-base: Cannot create symlink to ‘perl’: File exi...
The command run to un-archive is as follows: tar -zxvpf my_files_weekly.tar.gz --exclude=/etc/ssh/ -C / > /dev/null Results in the following errors: tar: ./usr/share/doc/udev: Cannot create symlink to ‘libudev0’: File exists tar: ./usr/share/doc/perl-base: Cannot create symlink to ‘perl’: File exists tar: ./usr/share/doc/vim-tiny: Cannot create symlink to ‘vim-common’: File exists tar: Exiting with failure status due to previous error However, when I specifically check these 3 mentioned directories exclusively for symlinks only like this: find -L /usr/share/doc/udev/ -xtype l -ls It reports no symlinks. I am lost. What am I missing here? For a second I thought it was perhaps the other way around and it tried to create the symlinks FROM these directories for/to "vim-common", "perl", "libudev0" and I have to find these symlinks lying around system-wide somewhere? Therefore I checked if there are any symlinks on the entire system: find -L -xtype l -ls It says there are no symlinks anywhere at all (if this command is correct though. I doubt it goes system wide). Nonetheless, my suppose that it creates symlinks FROM these directories TO the words mentioned is most probably totally wrong, but I was checking everything I could only come up with. How do I go about it and how do I extract this tar ball without it exiting due to these errors? Would **highly** appreciate any comments / suggestions / advice / assistance. Many thanks in advance! P.S. I also thought if I exclude these directories from un-packing like this it will fix the problem in one go alltogether: tar -zxvpf my_files_weekly.tar.gz --exclude=/etc/ssh/ --exclude=/usr/share/doc/perl-base/ --exclude=/usr/share/doc/vim-tiny/ --exclude=/usr/share/doc/udev/ -C / > /dev/null But... it didn't help either. The error is still there no matter what. ===== Extra Information.==== OK, I will edit it to add more information as suggested by Bodo in comments. adding -U either upper or lower case like this: tar -zxvpfu my_files_weekly.tar.gz --exclude=/etc/ssh/ -C / results in the following error: tar (child): u: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now –
Dennis (125 rep)
Jul 3, 2025, 06:09 AM • Last activity: Jul 5, 2025, 10:30 AM
21 votes
3 answers
5307 views
When I cd through a symlink, why does pwd show the symlink instead of the real path?
I created a soft link (`ln -s 1 2`) to a directory which is inside the `test` directory and opened the soft link (`cd 2`) and displayed the current path using `pwd`. The displayed path was `~/test/2` and not `~/test/1`. It's different in an OS like Windows, the shortcut brings us to the real directo...
I created a soft link (ln -s 1 2) to a directory which is inside the test directory and opened the soft link (cd 2) and displayed the current path using pwd. The displayed path was ~/test/2 and not ~/test/1. It's different in an OS like Windows, the shortcut brings us to the real directory. I'm little bit confused how this soft link works in Linux. Is it not a shortcut like in Windows? Why is the path not ~/test/1? $ mkdir test $ cd test $ mkdir 1 $ ln -s 1 2 $ cd 2 $ pwd /home/dazz/test/2
DScript (1083 rep)
Apr 16, 2015, 05:03 PM • Last activity: Jul 2, 2025, 03:14 PM
0 votes
2 answers
2777 views
Access windows symbolic link from linux cifs
I have created symbolic link of the mapped drive (DOS share) on Windows 7 computer 200.90.12.25. The symbolic link was created using mklink command. Trying to access this from Linux (Raspberry PI) using CIFS command, I get `mount error(5): Input/output error`. CIFS command and dmesg attached below....
I have created symbolic link of the mapped drive (DOS share) on Windows 7 computer 200.90.12.25. The symbolic link was created using mklink command. Trying to access this from Linux (Raspberry PI) using CIFS command, I get mount error(5): Input/output error. CIFS command and dmesg attached below. I cannot access the DOS share from Linux because of NETBEUI. Line diagram shown below for reference. enter image description here **CIFS command** sudo mount -t cifs -o user=username,guest,vers=2.0 //200.90.12.25/DOSA /home/pi/myNAS/myShare **dmesg** (also on the Linux client) [1027098.510573] FS-Cache: Duplicate cookie detected [1027098.510583] FS-Cache: O-cookie c=c6d9fc6c [p=33027f2d fl=222 nc=2 na=1] [1027098.510588] FS-Cache: O-cookie d=e8ce4e52 n=203d934d [1027098.510592] FS-Cache: O-key= '020001bd0a090c12' [1027098.510606] FS-Cache: N-cookie c=435e27ec [p=33027f2d fl=2 nc=0 na=1] [1027098.510611] FS-Cache: N-cookie d=e8ce4e52 n=9f19c9a0 [1027098.510614] FS-Cache: N-key= '020001bd0a090c12' [1027098.515854] CIFS VFS: cifs_mount failed w/return code = -5 As per the suggested comments, i have tried below commands. I got the same mount error(5): Input/output error sudo mount -t cifs -o username=username,guest,vers=2.1,mfsymlinks //200.90.12.25/DOSA /home/pi/myNAS/myShare mount.cifs sudo mount.cifs //200.90.12.25/DOSA /home/pi/myNAS/myShare -o username=username,guest,domain=domain,mfsymlinks any alternative solution much appreciated.
Bhuvan Kumar (51 rep)
Aug 2, 2020, 09:33 AM • Last activity: Jun 30, 2025, 01:05 PM
0 votes
1 answers
30 views
openSUSE 15.6 sysctl pointing to itself
I have just run ``zypper up`` on a openSUSE 15.6 computer and the installation of the new kernel says ``dracut-install error: /sbin/sysctl is pointing to itself`` and indeed this symbolic link is a loop: ``` king:~ # l /sbin/sysctl lrwxrwxrwx 1 root root 12 Feb 21 15:59 /sbin/sysctl -> /sbin/sysctl...
I have just run `zypper up on a openSUSE 15.6 computer and the installation of the new kernel says dracut-install error: /sbin/sysctl is pointing to itself` and indeed this symbolic link is a loop:
king:~ # l /sbin/sysctl
lrwxrwxrwx 1 root root 12 Feb 21 15:59 /sbin/sysctl -> /sbin/sysctl
~> uname -a
Linux king 6.4.0-150600.23.50-default #1 SMP PREEMPT_DYNAMIC Fri May  9 22:09:52 UTC 2025 (dee422c) x86_64 x86_64 x86_64 GNU/Linux
(I have two other openSUSE 15.6 computers where `/sbin/sysctl` is a elf 64-bit binary of Feb 21 same timestamp which is 27288 bytes in size). Do I need to repair this? by copying the binaries?
R. J. Mathar (121 rep)
Jun 12, 2025, 12:15 PM • Last activity: Jun 12, 2025, 07:12 PM
36 votes
5 answers
8241 views
How to tell if I'm actually in a symlink location from command line?
Suppose I have a folder: cd /home/cpm135/public_html and make a symbolic link ln -s /var/lib/class . Later, I'm in that directory: cd /home/cpm135/public_html/class The `pwd` is going to tell me I'm in `/home/cpm135/public_html/class` Is there any way to know that I'm "really" in `/var/lib/class` ?...
Suppose I have a folder: cd /home/cpm135/public_html and make a symbolic link ln -s /var/lib/class . Later, I'm in that directory: cd /home/cpm135/public_html/class The pwd is going to tell me I'm in /home/cpm135/public_html/class Is there any way to know that I'm "really" in /var/lib/class ? Thanks
Oliver Williams (1425 rep)
Dec 18, 2016, 12:16 PM • Last activity: Jun 11, 2025, 09:27 PM
1 votes
2 answers
54 views
Non-recursively Symlinks for a Directory
I’m trying to create a **single relative** symlink pointing public/train/train back to public/train, but my command ends up nesting infinitely. For example: ``` ln -snrf "$ROOT/public/train" "$ROOT/public/train/train" ``` After running this, I see: ``` public/ └─ train/ ├─ train → ../train │ └─ trai...
I’m trying to create a **single relative** symlink pointing public/train/train back to public/train, but my command ends up nesting infinitely. For example:
ln -snrf "$ROOT/public/train" "$ROOT/public/train/train"
After running this, I see:
public/
└─ train/
   ├─ train → ../train
   │  └─ train → ../../train
   │     └─ train → ../../../train
   │        …
But I only want:
public/
└─ train/
   └─ train → ../train
I need to keep the -r option so that the link target is relative. How can I create exactly one public/train/train→public/train symlink without further nesting?
Bhj (13 rep)
Jun 4, 2025, 09:20 AM • Last activity: Jun 4, 2025, 10:43 AM
4 votes
1 answers
2348 views
How to make $ORIGIN in RPATH not follow symlinks?
I have an executable `app`, which depends on a library `libbar.so` and loads it via `RPATH` with `$ORIGIN` like this: $ readelf -d app Dynamic section at offset 0xe08 contains 26 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libbar.so] 0x0000000000000001 (NEEDED) Shared l...
I have an executable app, which depends on a library libbar.so and loads it via RPATH with $ORIGIN like this: $ readelf -d app Dynamic section at offset 0xe08 contains 26 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libbar.so] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000f (RPATH) Library rpath: [$ORIGIN/lib/] It would be nice to run it in the appropriate directory structure, made with symlinks to the executable and the libbar.so: $ ls -R .: app@ lib/ ./lib: libbar.so@ -- but **the linker follows symlinks to the original file of the executable, sets $ORIGIN to the directory of the executable file and resolves the dependency paths from there. Is it possible to make it not do this?** So that directory-path-wise, in the search for lib files, the symlinks are treated as real files of the filesystem ("end-points" of the search). Also, some reasoning to this problem: 1. It is convenient to have binaries set up to **search for dependencies in a couple relational directories**, for instance in the $ORIGIN/ of a binary itself and also in $ORIGIN/appname_dependencies/ (so that one can just copy the binary and its' dependencies into one directory and run it, but also has a fall-back for a more complicated set-up with multiple versions of the same binary in the system). 2. Due to the requirement of **several dependency search paths, RPATH is the search method to use**: a "slashed" name of dependency (NEEDED Shared library: [./libbar.so]) sets only 1 search path. Also, for simplicity the dependency resolution paths should be in the binary itself. 3. It's nice to be able to combine all binaries (the application and all its' dependencies) into the **full dependency graph with links**, instead of copying the files. And **symbolic links are more resilient** than hard links: they link across filesystems. In fact, I have this problem in one academic environment of a linux cluster, where a hard link to parent directory cannot be done: $ ln ../afile ln: creating hard link ./afile' => ../afile': Invalid cross-device link
xealits (2267 rep)
Aug 10, 2016, 03:04 PM • Last activity: May 31, 2025, 05:05 AM
3 votes
1 answers
2884 views
symbol lookup error gdbus
Keep getting this error: /usr/bin/gdbus: symbol lookup error: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined symbol: g_date_copy looking at: root@server-sl:~# ldd /usr/bin/gdbus linux-vdso.so.1 (0x00007ffefddfa000) libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f77eaa...
Keep getting this error: /usr/bin/gdbus: symbol lookup error: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined symbol: g_date_copy looking at: root@server-sl:~# ldd /usr/bin/gdbus linux-vdso.so.1 (0x00007ffefddfa000) libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f77eaa5e000) libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f77eaa0a000) libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f77eaa04000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f77ea6f5000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f77ea538000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f77ea4c4000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f77ea4a1000) libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f77ea298000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f77ea07a000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f77e9e52000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f77e9e39000) libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f77e9ddd000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f77e9dd6000) /lib64/ld-linux-x86-64.so.2 (0x00007f77eac33000) libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f77e9d84000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f77e9d7a000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f77e9d71000) and checking this: root@server-sl:~# ls -l /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 lrwxrwxrwx 1 root root 26 set 22 05:53 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 -> libgobject-2.0.so.0.5800.1 I cannot find what's wrong. I'm on a DebianLinux server-sl 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64 GNU/Linux
user2239318 (141 rep)
Nov 22, 2018, 09:26 AM • Last activity: May 30, 2025, 06:07 PM
0 votes
1 answers
28 views
How to resolve a relative symlink to an absolute one without canonicalizing it?
On my machine, there is a file: `/var/lib/flatpak/exports/bin/com.github.tchx84.Flatseal` Which is a symlink whose content is: `../../app/com.github.tchx84.Flatseal/current/active/export/bin/com.github.tchx84.Flatseal` That is, a relative symlink pointing to the path: `/var/lib/flatpak/app/com.githu...
On my machine, there is a file: /var/lib/flatpak/exports/bin/com.github.tchx84.Flatseal Which is a symlink whose content is: ../../app/com.github.tchx84.Flatseal/current/active/export/bin/com.github.tchx84.Flatseal That is, a relative symlink pointing to the path: /var/lib/flatpak/app/com.github.tchx84.Flatseal/current/active/export/bin/com.github.tchx84.Flatseal That path itself contains some symlinks - current is a symlink to x86_64/stable/, and inside that, active is a symlink to 79456afc5a115a457bd99c85e428d47637ec978293aafb328ccc450c13bfeb80/. The absolute path is: /var/lib/flatpak/app/com.github.tchx84.Flatseal/x86_64/stable/79456afc5a115a457bd99c85e428d47637ec978293aafb328ccc450c13bfeb80/export/bin/com.github.tchx84.Flatseal I would like to make a copy of that original symlink somewhere else (say /home/foo/bin). I can't just copy it with cp -d (aka cp --no-dereference --preserve=links), because that simply copies the content of the symlink, and that's a relative path, so when copied to a different directory, it results in a broken link. As far as i can tell, there is no way to 'copy' a relative symlink in a way which actually changes it to preserve the resulting target. I can create a new symlink, but to do that, i need to know the absolute path pointed to by the original. How can i determine that? A simple readlink just reads the relative path. A readlink -f (aka readlink --canonicalize) or realpath fully canonicalises the link - it works out the absolute path, then goes through it and resolves all the other symlinks it finds. That results in a path with all the hexadecimal gibberish in it, which is not what i want (it will break as soon as i update that flatpak!). So how i can just read and resolve the actual symlink? Alternatively, is there a way to resolve a relative path against an absolute one?
Tom Anderson (1088 rep)
May 15, 2025, 08:56 PM
2 votes
1 answers
1999 views
cp -a fails to copy symlinks on virtfs
### Problem: Trying to copy the entire content of one directory to another which includes hidden files/directories and symlinks. This is fairly straightforward `cp -a ${src} ${dst}` It works as expected on my local VM but **it doesn't work properly on my VPS (hostgator). It fails to copy the symlink...
### Problem: Trying to copy the entire content of one directory to another which includes hidden files/directories and symlinks. This is fairly straightforward cp -a ${src} ${dst} It works as expected on my local VM but **it doesn't work properly on my VPS (hostgator). It fails to copy the symlinks if the link target comes later in the directory listing.** Considering that the original link targets work, are device local and I'm copying on the same device, what is the best way to make sure that the entire directory structure is copied exactly? It took me quite a while but I figured out that all I actually need to do is run the copy command twice and the second pass adds the missing links. Is there a better way than this? ### Working but Hack-ish Solution: src=".default/."; dst="tld.domain/"; cp -a ${src} ${dst}; cp -a ${src} ${dst}; I shouldn't need to double up the command to ensure that everything copied correctly. *I tried tar as well, same issue. I didn't try rsync but both seem like an overkill solution for something that should be a pretty trivial thing.* ### Scenario: For additional perspective in case it matters or I haven't be clear. I have created a template directory structure for website domains. After creating a new sub-domain on my web-host, I copy the template over to the sub-domain's document root. This is my subdomain and template (.default/) directory structure: sites/ .default/ .htaccess .www -> production/ production/ tld.domain.x/ tld.domain.y/ tld.domain.z/ So I create a new subdomain and then populate it's document root with the contents of the template directory. The issue here is that .www/ is a symlink to production/ but cp et al create everything in sorted order so it tries to create .www/ before creating production/ and consequently fails. My web-host is a *HostGator VPS running CentOS6* I can drill the issue down to some restriction on creating symlinks. My guess is that the VPS doesn't allow symlinks to external sources which would normally behave the same as an invalid link target. IE unknown source. Where neither names exist, calling on my VPS: ln -s foo bar Outputs: ln: creating symbolic link `bar': Permission denied If I create foo/ first then link, it works as expected. df -T . shows that **the filesystem type is virtfs**.
Fuzzy Logic (121 rep)
Mar 7, 2015, 01:55 AM • Last activity: May 2, 2025, 11:06 PM
0 votes
1 answers
3157 views
Undefined symbol after updating thc-hydra
I was using hydra without any issues until I decided to update it. Right now when I'm trying to run hydra I'm getting this error: > hydra: symbol lookup error: /lib/x86_64-linux-gnu/libmongoc-1.0.so.0: > undefined symbol: mongocrypt_kms_ctx_get_kms_provider I tried reinstalling both hydra and libmon...
I was using hydra without any issues until I decided to update it. Right now when I'm trying to run hydra I'm getting this error: > hydra: symbol lookup error: /lib/x86_64-linux-gnu/libmongoc-1.0.so.0: > undefined symbol: mongocrypt_kms_ctx_get_kms_provider I tried reinstalling both hydra and libmongoc-1.0 and trying to find something in terms of symlinks but with no luck. What is exactly going and and how can I prevent it/handle in the future and mostly how to fix it right now?
P0y01 (1 rep)
Feb 2, 2022, 06:36 PM • Last activity: Apr 26, 2025, 02:08 PM
1 votes
3 answers
8732 views
In my CentOS 7.2 the symbolic link is not the whole directory
This is the tutorial shows: [![enter image description here][1]][1] You can see the `/application/nginx -> /application/nginx-1.8.0` But I follow the steps: ``` [root@localhost nginx-1.8.0]# ll /application/nginx lrwxrwxrwx. 1 root root 12 5月 19 04:01 /application/nginx -> nginx-1.8.0/ ``` It is `ng...
This is the tutorial shows: enter image description here You can see the /application/nginx -> /application/nginx-1.8.0 But I follow the steps:
[root@localhost nginx-1.8.0]# ll /application/nginx
lrwxrwxrwx. 1 root root 12 5月  19 04:01 /application/nginx -> nginx-1.8.0/
It is nginx-1.8.0/, there is no /application in front it, and sure the nginx-1.8.0 is the Symbolic Link under the /application. My operating system is Cnet OS 7.2 The tutorial operating system is Cent OS 6.8 The difference between the tutorial if is the system reason?
qg_java_17137 (261 rep)
May 19, 2017, 04:15 AM • Last activity: Apr 18, 2025, 07:09 AM
3 votes
3 answers
6622 views
link config files
## Problem I'm trying to move my config files **from** a `.dotfiles` folder, and link those files to the corresponding config path. ## Example In this example I'm trying ```console $ ln -s ~/.dotfiles/nvim/init.vim ~/.config/nvim/init.vim ``` And the program (`nvim` in this case), the config file do...
## Problem I'm trying to move my config files **from** a .dotfiles folder, and link those files to the corresponding config path. ## Example In this example I'm trying
$ ln -s ~/.dotfiles/nvim/init.vim ~/.config/nvim/init.vim
And the program (nvim in this case), the config file doesn't take effect. But when I copy the file instead of linking
$ cp ~/.dotfiles/nvim/init.vim ~/.config/nvim/init.vim
It does take effect. ## Other example When I do the same thing but with my .zshrc file
ln -s .dotfiles/zsh/.zshrc ~/.zshrc
It takes effect... ## Question How could I link my .dotfiles config files to the according path for config? --- Thanks
Norman Perrin (31 rep)
Nov 17, 2019, 12:28 PM • Last activity: Apr 4, 2025, 07:05 AM
430 votes
15 answers
283905 views
How can I find broken symlinks
Is there a way to find all symbolic links that don't point anywere? ``` find ./ -type l ``` will give me all symbolic links, but makes no distinction between links that go somewhere and links that don't. I'm currently doing: ``` find ./ -type l -exec file {} \; | grep broken ``` But I'm wondering wh...
Is there a way to find all symbolic links that don't point anywere?
find ./ -type l
will give me all symbolic links, but makes no distinction between links that go somewhere and links that don't. I'm currently doing:
find ./ -type l -exec file {} \; | grep broken
But I'm wondering what alternate solutions exist.
gabe. (12124 rep)
Mar 15, 2012, 04:29 PM • Last activity: Mar 27, 2025, 08:01 AM
0 votes
0 answers
40 views
Apache symlink to directory on Raid Drive [not working]
I have a Debian installation. It's not my first (but my third server, not counting the multiple Raspberry Pis lying around). Let say my user is named "user1" Novelty for me, I have a - a first disk hosting / directory as well as home for user1 - a software Raid1 composed of two other disks, mounted...
I have a Debian installation. It's not my first (but my third server, not counting the multiple Raspberry Pis lying around). Let say my user is named "user1" Novelty for me, I have a - a first disk hosting / directory as well as home for user1 - a software Raid1 composed of two other disks, mounted with mdamd inside /media/raidMount I have apache2 running as "www-data". www-data is a member of user1 group. Inside my apache site enable conf I have this directive Options FollowSymLinks Indexes MultiViews I also have a symbolic link inside /var/www to /home/user1/Share1 named share1 When i browse to my localhost i can see share1 directory and browse into it. Till here all is well. **Now I tried to make a symbolic link to /media/raidMount/Share2 I cannot see it, and get no error by apache2.** I shall also add that /media/raidMount/ is fully owned by user1:user1 and with 754 permissions and mounted in fstab as /dev/md0 /media/raidMount ext4 defaults I had similar setup in the past but the drive wasn't software raid. I think permissions / ownership are set correctly. Is there some reasons for a raid to be seen differently by apache or by linux symbolic links? What I missing? Maybe mount options?
mapStack (1 rep)
Dec 25, 2023, 04:21 PM • Last activity: Mar 19, 2025, 10:40 AM
1 votes
0 answers
1123 views
nginx can't follow symlinks even after "disable_symlinks off;" setting
I have `django/gunicorn/nginx` based site. The static files when changed and deployed to the server get uploaded to `/home/username/src/static` folder. The website itself is provided from `/home/username/src` folder. Then I copy the static folder to `/var/www` folder and restart nginx. Everything wo...
I have django/gunicorn/nginx based site. The static files when changed and deployed to the server get uploaded to /home/username/src/static folder. The website itself is provided from /home/username/src folder. Then I copy the static folder to /var/www folder and restart nginx. Everything works. So to make things simpler and reduce the possibility of error. I decided to create a symlink in /var/www folder pointing to /home/usernam/src/static folder. I also added the disable_symlinks off; directive in nginx.conf file and restarted gunicorn and nginx. I am now getting net::ERR_ABORTED 403 (Forbidden) error. What should I do?
user1933205 (119 rep)
Apr 3, 2024, 06:23 PM • Last activity: Mar 19, 2025, 10:01 AM
1 votes
3 answers
124 views
In bash, how to resolve what is actually going to be executed?
Bash has the built-in command "type", which indicates how each argument would be interpreted if used as a command name, for instance: ``` $ type myfunction myfunction is a function myfunction () { echo hello } $ type myfunctionalias myfunctionalias is aliased to `myfunction' $ type python python is...
Bash has the built-in command "type", which indicates how each argument would be interpreted if used as a command name, for instance:
$ type myfunction
myfunction is a function
myfunction () 
{ 
    echo hello
}

$ type myfunctionalias
myfunctionalias is aliased to `myfunction'

$ type python
python is /usr/bin/python
In the last case, /usr/bin/python is a link, and its target is again a link:
$ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 7 Feb  5 09:05 /usr/bin/python -> python3

$ ls -l /usr/bin/python3
lrwxrwxrwx 1 root root 7 Feb  5 09:05 /usr/bin/python -> python3.13

$ ls -l /usr/bin/python3.13
-rwxr-xr-x 1 root root 14352 Feb  5 09:05 /usr/bin/python3.13
It is possible to resolve a link with "readlink -f", however it is tedious to do it manually, since i requires up to three steps: type to resolve the alias source, type to resolve the alias target, and readlink to resolve any link. In practice, I am more often interested in what will actually be executed, rather than the single resolution steps. So I need a "type"-like tool that resolves the aliases and the links, ideally:
$ clevertype python
/usr/bin/python3.13

$ clevertype --verbose python
python is /usr/bin/python
/usr/bin/python links to /usr/bin/python3
/usr/bin/python3 links to /usr/bin/python3.13
Result: python resolves to /usr/bin/python3.13
And:
$ clevertype pythonalias
pythonalias resolves to /usr/bin/python3.13

$ clevertype --verbose pythonalias
pythonalias is aliased to `/usr/bin/python'
/usr/bin/python links to /usr/bin/python3
/usr/bin/python3 links to /usr/bin/python3.13
Result: pythonalias resolves to /usr/bin/python3.13
Does such a tool exist?
ocroquette (160 rep)
Mar 12, 2025, 07:17 PM • Last activity: Mar 14, 2025, 03:11 PM
Showing page 1 of 20 total questions