0

I was listing directory , it display few file/directory with l on just ahead of permission columns and these have two names separated with -> with asterisk *(that means executable) . What means of this l

cd /opt/lampp/bin/
ll php*  
---- 
lrwxrwxrwx 1 root root       13 Nov 15 16:05 phpize -> phpize-5.5.15*
-rwxrwxrwx 1 root root     4522 Aug 20 17:23 phpize-5.5.15*

and how to execute these command or go inside these director. I have tried to executed with both name on terminal separately but both returns not a directory

/opt/lampp/bin$ phpize
No command 'phpize' found, did you mean:
 Command 'phpize5' from package 'php5-dev' (main)
phpize: command not found

/opt/lampp/bin$ cd phpize
bash: cd: phpize: Not a directory
5

It's a symbolic link, which is also indicated by the l in the first column. This is a common case, where the simple name of something is linked to the "real thing" with an exact version number. All of your scripts and commands can refer simply to /opt/lampp/bin/phpize. When version 5.5.16 or 5.6 is installed, you just have to change the link (or the installer does that for you).

"Not a directory": as you mentioned, the asterisk indicates that those are executables, not directories. The thing that usually appends an asterisk for executables puts a slash / for directories. So cd is not applicable.

Your problem running an executable in the current directory is a common one. The short version is that if you specify just a name, the shell will search your PATH. It is common and recommended practice that your current directory not be in your PATH. So what everyone does is simply specify the current directory: ./phpize

Alternatives are to specify the whole path, as I have above. That will of course work no matter what the current directory is. Or you can add this directory to your PATH. If you have lots of directories with just one or two executables you use often, that can get unwieldy. So another use of symbolic links is to create links to these scattered executables (linking to the short no-version name -- links can be nested) and putting all these new links in a single directory that you do add to your PATH. So now when you type just the name, the shell with search the PATH, find the secondary link, which jumps to the primary link, finds the exact executable, and runs it.

  • but i am unable to go into this 'cd: /opt/lampp/bin/phpize: Not a directory' – diEcho Nov 16 '14 at 15:09
  • Thank you for the reply. Please look the updated question – diEcho Nov 16 '14 at 15:29
  • Thank you for clearing the confusion with $PATH – diEcho Nov 17 '14 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.