Tag Info

Hot answers tagged

4

You have mistaken the output of at least one command. The permissions of a symbolic link are always rwxrwxrwx, or rather they don't have permissions at all: $ touch file $ ls -l total 0 -rw-rw-r-- 1 muru muru 0 Dec 5 20:53 file $ ln -s file link $ ls -l total 0 -rw-rw-r-- 1 muru muru 0 Dec 5 20:53 file lrwxrwxrwx 1 muru muru 4 Dec 5 20:53 link -> ...


4

Use the file command. [sreeraj@server ~]$ ls -l mytest lrwxrwxrwx 1 sreeraj sreeraj 15 Dec 12 09:31 mytest -> /usr/sbin/httpd [sreeraj@server ~]$ file mytest mytest: symbolic link to `/usr/sbin/httpd' or [sreeraj@server ~]$ file -b mytest symbolic link to `/usr/sbin/httpd' [sreeraj@server ~]$ Also, please go read through man page of ls and check ...


3

Easiest way apt-get install firefox this will update to new one or which firefox this will give you path of firefox then replace the same sudo ln -fs $HOME/Desktop/firefox/firefox /usr/bin/firefox For Ex. which firefox /usr/bin/firefox sudo ln -fs $HOME/Desktop/firefox/firefox /usr/bin/firefox


3

There are two ways to fix this: You can alter your $PATH variable so that the directory where the new firefox version lives is checked before any other directory, by running the command export PATH=$HOME/Desktop/firefox:$PATH And if you add that same command to your .bashrc, all your future sessions will have the new PATH too. You can use ln to symlink the ...


3

ls unfortunately doesn't have an option to retrieve file attributes and display them in an arbitrary way. Some systems have separate commands for that (for instance GNU has a stat command or the functionality in GNU find). On most modern systems, with most files, this should work though: $ ln -s '/foo/bar -> baz' the-file $ LC_ALL=C ls -ldn the-file | ...


2

A symlink won't work. A hard link (when possible) won't work either because both files will have the same permissions. But I'd do the following: instead of a link, write a shell script /usr/bin/myscript.py that executes the script itself: #!/bin/sh exec python /path/to/wherever/I/have/put/myscript.py "$@" The "$@" passes any parameters through; if your ...


2

-rw--r--r-- 2 kamix users 5 Nov 17:10 hardfile.txt ^ That's the number of hard links the file has. A "hard link" is actually between two directory entries; they're really the same file. You can tell by looking at the output from stat: stat hardlink.file | grep inode Device: 805h/2053d Inode: 1835019 Links: 2 Notice again the ...


2

A hard linked file has more than one link (the 2 after the permission flags). You can use the stat command to easily extract this information: $ stat --printf '%h\n' hardfile.txt 2 See the manpage for stat (man 1 stat) for information about other values and how to print them.


2

I assume you are using bash, so I would use globstar to loop through all directories at once with **. After that all what is left is to play a little bit with readlink, realpath, etc: shopt -s globstar for file in c1/** d1/**; do if [[ -h "$file" ]]; then if [[ "$(readlink -f "$file")" == "$(realpath a/b/original-target)" ]]; then ln ...


1

Why you downloaded the version, you apparently did not install it in one of the directories in the PATH variable. When you execute simply 'firefox' it will find firefox in the first directory using the PATH directory. If you execute firefox with a more fully qualified name it will use whatever is found in that SPECIFIC directory only. The easiest thing to ...


1

With a GNU ls at least (and, apparently, tcsh's implementation) you can hack the $LS_COLORS environment variable to insert delimiters where you like (but tcsh's builtin ls-F doesn't do link targets - only link flags) Usually ls inserts arbitrary non-printable terminal escapes based on the values stored within that environment var, but there's nothing ...


1

pax can be really useful in these cases. In fact it would be easier if I could discover a pax that does the -o listopt=... option specified by POSIX but, despite my looking, I've yet to find one that does. I use the one mirabilos maintains - the BSD pax (mirabipax?) - which is probably the one most others do as far as I know. Anyway you get to regex ...


1

The $PATH environment variable is only used when you run an executable. In your case, you've symlinked a directory. As a directory isn't an executable, then your shell will not search $PATH for it. If you symlink to an executable, you'll find that it works as expected.


1

None of the following are the real reason for disallowing hard links to directories; each problem is fairly easy to solve: cycles in the tree structure cause difficult traversal multiple parents, so which is the "real" one ? filesystem garbage collection The real reason (as hinted by @Thorbjørn Ravn Andersen) comes when you delete a directory which has ...



Only top voted, non community-wiki answers of a minimum length are eligible