Skip to main content
Post Closed as "Duplicate" by jasonwryan, Gilles 'SO- stop being evil' bash
edited tags
Link
jimmij
  • 48.7k
  • 20
  • 136
  • 141
Source Link
asura
  • 309
  • 2
  • 4
  • 8

how to execute a bash script without typing ./

It has been bugging me for a very long time and I'm really sick of it. For example there's a script called testscript that compares two directories. In class the prof can just type

testscript dir1 dir2 

to get the output, but I have to add ./ before the testscript and hit enter. Then enter dir1 and dir2 next line

How did the prof do that? Is it something with the bashrc thing? I never get how it works. If it's related please explain in plain simple language since I'm new to Linux. Thank you!