how to create symbolic link in linux. | create symlink | Access any tool from anywhere in Linux distro (kali).

What is symlink (symbolic link)...?

 A symlink is also known as symbolic link or Soft Link. It is a shortcut for an absolute or   relative path to a directory or file, as you use shortcuts in windows. symlink points to   actual file in linux file system.


How to identify symlink in linux..?

create symlink
create symlink

                           
 In
red underline 'l' represents link (symlink).

 green underline represents symlink

 and

 blue underline represents actual file, from which the symlink created.


Let's create symlink :

  Firstly, we created a python file, which takes input and display on screen. You use any text editor to create it, I used 'nano'

create symlink
 create symlink




  Now test it, give execution permission to file for which you want to create symlink, using (chmod +x simple.py (after giving permission file colour will change.)) and then run it.
 
create symlink
 create symlink


Ma Sha Allah its works....


now create symlink .....

                            Syntax: ln -s <path to actual file> <path to symlink> and hit enter.


   

create symlink
 create symlink



create symlink successfull. 

note: see actual file name and symlink name will be same, but difference is symlink not contain extension.

create symlink
 create symlink

You can see that symlink created successfully.

How we access tool from any where in linux distro.?

you can see that  i used path to symlink is '/usr/local/sbin'. this path is in $PATH (environmental) variable of linux. whenever we enter command , linux first check command path in $PATH variable and run command. so, we created symlink in '/usr/local/sbin'
 

create symlink
 create symlink


Finally, we run it from '/home/kali' directory by just entering command 'simple'. You can also run it from any other directory.



----------Links--------

Comments

Popular posts from this blog

screen mirroring | screen mirror in kali linux using android scrcpy (without installing any mirroring app).

CSL Search writeup