I am new to linux, and I am learning bash scripting at the moment. I was wondering how I would save my script as a command and then be able to call that command anywhere in the terminal. So i could save the command in a folder somewhere, but be able to use that command in a different folder without having to type out the path to said command.
Is there a way to do this? For example, I make a script that runs chmod +x 'file'
and then takes an argument for the file to run the command on. How would i go about coding this and then saving it so i can call that script from anywhere.
Sorry if i didn't explain my question too well, and thank you for any help with my problem.