New answers tagged

0

Your link points to /folder2.Your pwd is /folder1/linkToFolder2, that is the same than /folder2/, and 'ls ..' in all the cases should show you the above directory, wether if you are in /folder1 or /folder2


1

Dropbox apparently doesn't support symlinks. So deleting a symlink from the Dropbox GUI deletes the link, as well as the items pointed to.


4

As you figured out, ln only replaced symlinks. Fixing this will involve at least reinstalling the packages which provide the missing symlinks... Using find's -L option combined with the -type l test allows broken symlinks to be identified; then dpkg -S will identify the corresponding package in most cases: dpkg -S $(find -L /usr/bin -type l) Filtering ...


-1

no way it should create those symbolic links on same path with the same filenames as the origin. it should throw an error that file exist already. to prove that it will not, here's the output in my vm on same distro with same command.


1

readlink -f "$(type -P sleep)" or if you're performance-conscious: cpath="$(type -P sleep)"; [ ! -L "$cpath" ] || cpath="$(readlink -f "$cpath")" Using readlink -e (existing) instead of readlink -f can save you from this kind of accident where you operate on a nonexisting file. The second example assumes the path returned by type -P is canonical, which ...


1

dd in your example does full system image backup, byte to byte mirroring /dev/sda to /dev/sdb. However you must be sure that /dev/sdb if equal or larger size disk. Modern systems do not permit plain copying like that because they embed some other unique identity information like UUIDs into volumes; there maybe issues with LVM setups, on-disk cryptography ...


3

The first reason that comes to mind is that since that is an absolute link (it points to /data/git and not ../git), this will allow it to still work even if you move the directory later. So, say you install the system in /data/git/git and then decide to move the final git directory somewhere else, say /foo/bar/git. Now, the /foo/bar/git/git link will still ...


1

Modular config files as a text processing function What you're asking for is more properly text processing than file processing, and it's largely dependent on what program is consuming the text files. The traditional straightforward way to do what you want is to have a top-level file that includes other files in a modular way, such as: ~/.bash_profile: ...


2

A symlink already behaves like a Windows shortcut, as it contains only a path to the target file. It just looks like the symlink is targeting the file to install the game instead of the file to run the game.


3

You already have a directory called drush8 in /usr/bin, you can't also have a link (or any other kind of file) with the same name. If you want drush8 to work as a command, you could add the appropriate folder to your $PATH or define an alias. Generally speaking folders such as drush8 would go in /opt, that way you'd avoid this problem... Strictly speaking ...


3

What you want is pwd -P. From man pwd on CentOS 6: -L, --logical use PWD from environment, even if it contains symlinks -P, --physical avoid all symlinks Or, from the BSD pwd man page and slightly more helpfully worded: -L Display the logical current working directory. -P Display the physical current working ...


1

From man pwd on my Ubuntu: your shell may have its own version of pwd I use bash. Simple pwd command gives me a path with respect to the symbolic link; yet /bin/pwd returns the actual path. The cd command is also a bash builtin. In other words: this is shell specific. EDIT: thrig's comment (see below) seems to be a better alternative to everything I ...


0

Simplest way for you is to use bash alias, as example In case you talking about user command input. Another way to do that, is filesystem in user space FUSE Python implementation of fuse basic filesystem - https://www.stavros.io/posts/python-fuse-filesystem/ Unfortunately list of fuse filesystems is broken(was on FUSE sourceforge, they moved, list is't), ...


2

What you're looking for is possible, but perhaps not exactly as you envision. The way I have seen it done most often (and it is admittedly a very rare occurrence) is to create the file being read a named pipe (aka FIFO) special file, using the mknod command: mknod file.txt p You would then need to start the script you want to use to generate the "file ...



Top 50 recent answers are included