LinuxQuestions.org
Review your favorite Linux distribution.
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


Closed Thread
  Search this Thread
Old 01-24-2010, 06:01 AM   #1
mostafaashish
LQ Newbie
 
Registered: Aug 2009
Posts: 6

Rep: Reputation: 0
Exclamation Make a file executable and then run


Dear Friend

I have created a file named as pm under the path /home/ppp/ i.e. /home/ppp/pm

To make it executable, I've used command: chmod a+x /home/ppp/pm while residing in root directory.

But while trying to run from root by typing ./pm or within the directory /home/ppp, it was displaying that directory not found.

Please help by providing the step by step procedure, so that I would be able to run my file from root or from the directory.



Regards
mostafaashish
 
Old 01-24-2010, 06:07 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
What kind of file is it?
is it a script or..What happens if you use
Code:
/home/ppp/pm
You can put the file in your path (eq /usr/local/bin)

Last edited by repo; 01-24-2010 at 06:10 AM.
 
Old 01-24-2010, 06:11 AM   #3
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,031

Rep: Reputation: 63
Quote:
Originally Posted by mostafaashish View Post
Dear Friend

I have created a file named as pm under the path /home/ppp/ i.e. /home/ppp/pm

To make it executable, I've used command: chmod a+x /home/ppp/pm while residing in root directory.

But while trying to run from root by typing ./pm or within the directory /home/ppp, it was displaying that directory not found.

Please help by providing the step by step procedure, so that I would be able to run my file from root or from the directory.



Regards
mostafaashish
Post:
Code:
ls -lR /home/ppp
 
Old 01-24-2010, 06:33 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Also

file pm
 
Old 02-19-2014, 01:50 AM   #5
why_so_serious
LQ Newbie
 
Registered: Oct 2013
Posts: 26

Rep: Reputation: Disabled
Is it program? what kind of file?
 
Old 02-19-2014, 03:56 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,178

Rep: Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562
Did you add in the shebang?
 
Old 02-19-2014, 10:28 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,232

Rep: Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522
until the OP posts back that it is a shell script or a c program or a python script or a java program
or what ever it is

there is nothing to do .....

and it has been 3 weeks
so i would guess that the OP is long gone

Last edited by John VV; 02-19-2014 at 10:31 PM.
 
Old 02-20-2014, 06:34 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by why_so_serious View Post
Is it program? what kind of file?
Please, don't resurrect old threads, especially for asking a question instead of providing further and useful feedback to the OP. This one is 4 years old. You are free to open a new thread about this topic, if you wish. Let's this thread rest in peace.
 
  


Closed Thread


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
how to make any file executable kratosal Linux - Newbie 8 04-08-2008 04:50 AM
Make newly created file executable Black Chaos Linux - General 3 08-03-2006 11:53 AM
How to make a bin file executable and install the prgram shariqali Linux - Software 6 03-29-2006 02:11 PM
can't run the executable file after compiling with g++ compiler moondog1129 Linux - Laptop and Netbook 2 02-06-2006 10:24 PM
Run executable file compiled by kylix and mysql in Fedora Core 4 aa_husni Fedora 0 09-15-2005 01:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:39 PM.

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