Linked Questions

12
votes
4answers
33k views

how to execute a bash script without typing ./ [duplicate]

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 ...
0
votes
3answers
11k views

What does ./ mean? [duplicate]

I'm having a hard time getting what ./ does. In the Linux Essentials books, it asks me in an exercise to delete a file named -file. After googling, I found that I need to do rm ./-file but I don't ...
1
vote
2answers
4k views

Why when we run a executable file we need to add ./ ahead? [duplicate]

Say I have a somecommands.sh and I use chmod 777 to make it executable. Why I have to type ./scommand.sh instead of typing just somecommand.sh to run it from its own directory? Does this make any ...
-3
votes
2answers
4k views

Shell Script not working whenever I run it [duplicate]

I have a simple script that terminates some processes and closes ports as below. I am running metasploitable. However, whenever I run this, it gives the below error. (note that on this file everyone ...
4
votes
3answers
422 views

Why do you need the “./” when executing programs in the current directory? [duplicate]

Possible Duplicate: Why do we use “./” to execute a file? It seems redundant and gets annoying after a while -- is there a way to change this? If not, can somebody explain the ...
0
votes
1answer
333 views

What does “./” do? [duplicate]

I've got absolutely no idea what this does and if I search something like "linux ./ command", Google just seems to ignore those two characters as they're puntuation. If someone can give me a simple ...
-1
votes
1answer
218 views

Why is ./filename required to run executable script? [duplicate]

After creating a Python script file, test.py, in my home directory, and running chmod +x test.py to make it executable, and placing #!usr/bin/env as the file header, I expected to be able to run the ...
0
votes
2answers
198 views

Why do I have to execute bash programs with ./? [duplicate]

Why is it that some bash programs will only run on my system when I type ./ before their name? An example: In my [...]/android/sdk folders I have to execute adb like this: ./adb devices Why not ...
-1
votes
1answer
102 views

Why is “./” used when executing a program? [duplicate]

If I have a program named foo, why do I need to say ./foo and not simply foo? Doesn't ./ just mean within the current directory?
1
vote
1answer
46 views

Linux's command line behaviour (Ubunto/Deb) in running an executable file [duplicate]

@user-123:~$ Downloads/execfile-3.4/execfile @user-123:~$ @user-123:~$ cd Downloads/execfileparentdir-3.4/ @user-123:~/Downloads/execfileparentdir-3.4$ execfile execfile: command not found @user-123:~...
-1
votes
1answer
48 views

shellscript is having trouble finding a file [duplicate]

I have a shellscript that is having trouble finding a file. The text file exists so I don't understand what the issue is. #!/bin/ksh goodmain $1 | sed -e '1,/mmxxaa/d' $ ls -l total 1364 -rwxr-xr-x....
49
votes
3answers
23k views

Is it safe to add . to my PATH? How come?

I've seen people mention in other answers that it's a bad idea to include the current working directory ('.') in your $PATH environment variable, but haven't been able to find a question specifically ...
6
votes
1answer
3k views

ps command not giving output in home directory

I am logging into a solaris server, switching to bash, then switching to another user "sruser" and switching to bash. /home/batch/sruser/ is the home directory of the user "sruser". The issue is ps ...
1
vote
1answer
2k views

Why can't I run mysql?

I'm trying to import a database from Wamp to Xampp. I run Lampp first, then go to /opt/lampp/bin and run: mysql (or mysqladmin ?) -u root -h localhost but I get: mysql: command line not found ...
0
votes
1answer
431 views

What' the subtle difference between `test.sh` and `./test.sh`

I have the following script: $ cat test.sh #! /usr/local/bin/bash date Run it, $ test.sh -bash: test.sh: command not found It works $ ./test.sh Thu Oct 25 18:04:45 CST 2018 Nonetheless, I am ...