Tag Info

Hot answers tagged

7

Becoming familiar with your file system layout is all part of becoming a competent user - any time you spend with that aim in mind is not time wasted. However, with that said, you can indeed make it easier to move around the file system. Note that in Linux/UNIX, the file system is presented as a single tree, no matter how many devices make up your storage, ...


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 ...


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

Not at all. One involves redirecting all references to a file name ( any kind of file ) to a different file instead ( symlinks ), and the other involves building an executable image by copying code from a library into the executable ( static linking ) or referencing a dynamic library that contains the required code and loading that dynamic library at ...


3

You could just set up some alias', like: $ alias abc="cd /home/user/Desktop/Folder" To store these for the longer term add them to your .bashrc file. This will work if it's just navigation you're looking for - however the 'abc' above won't be any use if you want to script anything. I personally think it might be as easy in the long run to learn and ...


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 | ...


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 ...


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 ...


2

The first line looks wrong. That should probably be nameofuser=`logname` What you posted doesn't assign anything to nameofuser, and then you try to use it and it evaluates to an empty string.


1

I would like to recommend the z utility - https://github.com/rupa/z (which is inspired by another utility named j). What z does is override your shell's cd function to add a side-effect of logging all the directories you visit. These directories are stored in the file ~/.z in a descending order of "frecency", such that a directory would appear higher if it ...


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 ...



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