LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-07-2014, 10:21 AM   #1
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Rep: Reputation: 30
No such file or directory


how do I fix this error ?

Code:
bt@maq:~/scan$ ./pscan2
-bash: ./pscan2: No such file or directory
 
Old 03-07-2014, 10:25 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,788
Blog Entries: 1

Rep: Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340
1) have you done an 'ls -al' to see if the file exists?
2) have you checked the file mode of the file to make sure its executable?
 
Old 03-07-2014, 10:26 AM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Is the file present?
What permissions does it have?
... to start with...
 
Old 03-07-2014, 10:53 AM   #4
stomach
Member
 
Registered: Sep 2005
Distribution: Debian
Posts: 202

Original Poster
Rep: Reputation: 30
-rwxrwxrwx 1 bt bt 21407 Jul 21 2004 pscan2
 
Old 03-07-2014, 11:11 AM   #5
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
2 possibilities:

Is it a text-file?
If so, does it have the initial "shebang" - like "#!/bin/bash"?
One cause could be that it might have been saved in DOS format, although that normally spits out a different error. Check with "cat -e pscan2". Use dos2unix, or an editor like 'nano' that can save in other format to convert it.

Is the file 'pscan2' in the right binary format - that is, 64-bit binary on 32-bit system will not work.
 
Old 03-07-2014, 12:08 PM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by stomach View Post
-rwxrwxrwx 1 bt bt 21407 Jul 21 2004 pscan2
Also, there's a possibility that file is located somewhere else and you're invoking it from a different location. However, try to invoke it using it's full path as:
Code:
bt@maq:~/scan$ /path/to/pscan2
For example:
bt@maq:~/scan$ /home/jack/scripts/pscan2
Moreover you can check the file lcoation using find cmd as:
Code:
bt@maq:~/scan$ find / -name 'pscan2' -print
 
Old 03-07-2014, 12:12 PM   #7
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
A sidenote: The file pscan2 is world writable, not good!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
su:warning: cannot change directory to home/orausr: No such file or directory cdhar Linux - Newbie 4 09-11-2012 07:17 AM
chroot:cannot change root directory to: No such file directory janakiramulu Linux From Scratch 5 04-23-2011 02:00 AM
Get first file of directory then copy to other directory andd rename the file Faye Linux - Software 4 01-30-2011 10:16 AM
Copying a single file into each directory of a directory tree mlapl1 Linux - Newbie 2 06-27-2007 11:18 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-04-2006 12:08 AM


All times are GMT -5. The time now is 08:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration