Linked Questions
24 questions linked to/from Why do we use "./" (dot slash) to execute a file in Linux/UNIX?
16
votes
4
answers
55k
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 ...
1
vote
3
answers
17k
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 ...
2
votes
2
answers
6k
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
2
answers
23k
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
3
answers
527
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
1
answer
372
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
vote
1
answer
160
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
1
answer
260
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
2
answers
239
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 just ...
-1
votes
1
answer
195
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
votes
1
answer
67
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....
56
votes
4
answers
31k
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 ...
3
votes
2
answers
8k
views
What is the use of adding "." (dot) in path variable?
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/...
7
votes
1
answer
5k
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
1
answer
3k
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
Why ...