execution without ./

I want to execute a shell script without ./ symbol.
For example:

./my_script ===== my_script (both of them can execute my script)

both of them are the same as result.

copy the script as root to /usr/bin or /usr/local/bin and give it +x permissions.
Then chown it for your user = chown user:group /usr/bin/script

You could update your PATH environment in whatever your login profile is (.profile, .bash_profile, etc ...)

PATH=$PATH:path_to_myscript

I don't know unix very well. Plaese explain in details.

./filename means the "filename" present in the same folder. "." is used to represent the current directory so ./filename means filename present in the same folder. like sysgate suggested to place the file in the /usr/bin folder which holds all other files and usually the path is defined in .profile path so everytime you just run the Filename as a command it will execute from the folder /usr/bin.

as andryk suggested to add the new path to the path variable. so that when you run the filename as command so that unix will look into the folders defined in the path variable.

Note: path is used to define the locations, so that you dont need to specify the path every time. and you can run the filename as commands.

copy the script as root to /usr/bin or /usr/local/bin and give it +x permissions.
Then chown it for your user = chown user:group /usr/bin/script

I have a question:

When I chown for the user,is true the username of the person to be allowed to use the script? "chown bobo:group /usr/bin/script"...

This is like parking your car in the living room.

An option which is possible, however not how it is intented to be.

The proper way to do is to expand the PATH environment variable.

The PATH environment is a search path.
When ever you enter a commad (script) without using a path prefix, all directories defined in the PATH environment variable are searched for the presence of the command (script).

The PATH environment variable can be defined system wide (affects all users) or on a persoal base (individual for each user).

In general we see a combination of the 2.

the PATH variable is defined in the "profile" files.

Those which affect all users are located in the /etc directory, like /etc/profile and those which are individual are located in the home directory of each user like the .profile file in an users homedirectory.

Which "profile" files are used depends on your default shell.

See the manual pages for each shell to find out which are the "profile" files.

Allthough it is possible, it is not a display of proper system maintenance to put your personal scripts and executables in system directories like /usr/bin

On a Windows PC you don't put your personal programs neither in the c:\windows\sysem32 directory allthough it is very well possible.

But then, if you want to create chaos on your system, who am I to stop someone.