Thursday, September 29, 2011

What is Symbolic link and Hard Link and how to create it on Mac

Symbolic link is the one file on your file system (FS) that holds in itself only one string that is the link to the specific file/directory/archive/etc in your FS.
Hard link is also some file that holds link on some file, but it should be one file on the same partition (and only a file, not a directory or anything else).

In order to create the Symbolic link go to the Terminal and use this command:
ln -s source_file file_name

Notice that file_name will be created even if source_file is not exist yet.

You can check this topic in wikipedia: 

Wednesday, September 28, 2011

How to figure out in Terminal the process on a specific port

In order to figure out the current process on a specific port use this command (for example ports 8888 and 9997):


lsof -w -n -i tcp:8888
kill -9 enter here the PID


lsof -w -n -i tcp:9997
kill -9 enter here the PID

How to set MAKE command on Mac

Actually, the MAKE command should be already installed on your Mac if you have Xcode installed. But in my case MAKE have been disappeared after update from Snow Leopard to Lion OSX. By some reason PATH to MAKE was changed. So what you need to do in this case in order to make MAKE available - fix PATH e.g:

Apples-MacBook-Pro:t0-mvn apple$ make
-bash: make: command not found
Apples-MacBook-Pro:t0-mvn apple$ ls /Developer/
.DS_Store                    Documentation/               Icon^M                       SDKs/
About Xcode and iOS SDK.pdf  Examples/                    Library/                     Tools/
About Xcode.pdf              Extras/                      Makefiles/                   usr/
Applications/                Headers/                     Platforms/                   
Apples-MacBook-Pro:t0-mvn apple$ ls /Developer/usr/
X11/          etc/          lib/          llvm-gcc-4.2/ sbin/         
bin/          include/      libexec/      local/        share/        
Apples-MacBook-Pro:t0-mvn apple$ ls /Developer/usr/bin/
Display all 173 possibilities? (y or n)
Apples-MacBook-Pro:t0-mvn apple$ ls /Developer/usr/bin/ma
make            malloc_history  mapc            
Apples-MacBook-Pro:t0-mvn apple$ ls /Developer/usr/bin/make 
/Developer/usr/bin/make
Apples-MacBook-Pro:t0-mvn apple$  /Developer/usr/bin/make 
make: *** No targets specified and no makefile found.  Stop.
Apples-MacBook-Pro:t0-mvn apple$ export PATH=$PATH:/Developer/usr/bin/
Apples-MacBook-Pro:t0-mvn apple$ make
make: *** No targets specified and no makefile found.  Stop.


Then you probably will want to change your PATH variable in your profile configuration. Do this:


$ vi ~/.profile


////
export PATH=/opt/subversion/bin:$PATH:/Developer/usr/bin

Thursday, September 22, 2011

Where profile located on your Mac OSX

If you want to view/edit profile settings on your Mac try do this:
Open Terminal and execute this command:
vi ~/.profile