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 04-16-2005, 02:21 PM   #1
neuropulse
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Rep: Reputation: 0
How To Run Program From Command Line?


Greetings,

I am new to using the command line. What do I type to run a program? I have navigated to the program's directory on a CD.

Thanks
 
Old 04-16-2005, 02:24 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
If the program is in a directory your PATH variable then just type it's name. To launch another program use the full path - ie /path/to/program or cd to the directory and run ./program
 
1 members found this post helpful.
Old 04-16-2005, 06:46 PM   #3
Hosiah
Member
 
Registered: Sep 2004
Location: Des Moines, Iowa
Distribution: Slackware, Mandriva, Debian derivatives, +BSD/ Solaris/ Minix/ plan9/ GNU/HURD...
Posts: 185

Rep: Reputation: 31
Top 10 tips for the Linux command line:
(email this to ten friends!)

If you don't know about "foo", type:

10 "info foo"
or
9 "man foo"

if you can't find "foo", type:

8 "locate -i foo"
or
7 "whereis foo"

if you want to view "foo":

6 "less foo"
or
5 "emacs foo"

4 just about any program, when you type it's name and "-h" or "--help" will print out a usage message.

3 to navigate "down" into a directory named foo, type "cd ./foo"

2 to navigate "up" into any higher directory, type "cd ../"

1 to see what's in the directory that you're in, type "ls"

and bonus rule 0: read everything readable in your system. You practically have a library at your fingertips!

Last edited by Hosiah; 04-16-2005 at 06:49 PM.
 
1 members found this post helpful.
Old 05-27-2020, 09:57 PM   #4
nh_linux
LQ Newbie
 
Registered: Jul 2006
Location: In the world! :-)
Distribution: Linux Mint 19.3.
Posts: 25

Rep: Reputation: 1
Quote:
Originally Posted by Hosiah View Post
Top 10 tips for the Linux command line:
(email this to ten friends!)

If you don't know about "foo", type:

10 "info foo"
or
9 "man foo"

if you can't find "foo", type:

8 "locate -i foo"
or
7 "whereis foo"

if you want to view "foo":

6 "less foo"
or
5 "emacs foo"

4 just about any program, when you type it's name and "-h" or "--help" will print out a usage message.

3 to navigate "down" into a directory named foo, type "cd ./foo"

2 to navigate "up" into any higher directory, type "cd ../"

1 to see what's in the directory that you're in, type "ls"

and bonus rule 0: read everything readable in your system. You practically have a library at your fingertips!

I tried the commands out. I left out one of the commands because it's output was huge! Anyway, check this out:

elothas@elothas-Inspiron-3593:/$ info foo
info: No menu item 'foo' in node '(dir)Top'
elothas@elothas-Inspiron-3593:/$ man foo
No manual entry for foo
elothas@elothas-Inspiron-3593:/$ emacs foo

Command 'emacs' not found, but can be installed with:

sudo apt install emacs25
sudo apt install emacs25-nox
sudo apt install e3
sudo apt install emacs25-lucid
sudo apt install jove

elothas@elothas-Inspiron-3593:/$ whereis foo
foo:
elothas@elothas-Inspiron-3593:/$ foo -h

Command 'foo' not found, did you mean:

command 'goo' from deb goo
command 'fop' from deb fop
command 'fox' from deb objcryst-fox
command 'fog' from deb ruby-fog
command 'fio' from deb fio
command 'woo' from deb python-woo
command 'fgo' from deb fgo

Try: sudo apt install <deb name>

elothas@elothas-Inspiron-3593:/$ cd ./foo
bash: cd: ./foo: No such file or directory
elothas@elothas-Inspiron-3593:/$

Regards,

Nick.
 
Old 05-27-2020, 10:18 PM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,847

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Check out this YT video: https://www.youtube.com/watch?v=IVquJh3DXUA

Search the web with "Linux Shell Hello World script program"

Good luck!!
 
Old 05-27-2020, 10:28 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 20,878

Rep: Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775Reputation: 3775
nh_linux,
Basically "foo" is merely a place holder for a real program or variable, does not really exist and is used for demonstration purposes.

https://en.wikipedia.org/wiki/Foobar
 
1 members found this post helpful.
Old 05-27-2020, 10:45 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,464

Rep: Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270
I wonder what linux program might be on a CD???

"I have navigated to the program's directory on a CD."
 
Old 05-27-2020, 11:20 PM   #8
nh_linux
LQ Newbie
 
Registered: Jul 2006
Location: In the world! :-)
Distribution: Linux Mint 19.3.
Posts: 25

Rep: Reputation: 1
Quote:
Originally Posted by JJJCR View Post
Check out this YT video: https://www.youtube.com/watch?v=IVquJh3DXUA

Search the web with "Linux Shell Hello World script program"

Good luck!!
Thanks, likewise!

Something else. The youtube hyperlink that u posted has a syntax error. I mention this because after I clicked on the link,my browser's address line displayed " freetube://https://www.youtube.com/watch?v=IVquJh3DXUA ". No wonder why it didn't work the first time. I just edited the url. in address line then it worked. Thanks for this.

Last edited by nh_linux; 05-27-2020 at 11:31 PM.
 
Old 05-27-2020, 11:41 PM   #9
nh_linux
LQ Newbie
 
Registered: Jul 2006
Location: In the world! :-)
Distribution: Linux Mint 19.3.
Posts: 25

Rep: Reputation: 1
Quote:
Originally Posted by michaelk View Post
nh_linux,
Basically "foo" is merely a place holder for a real program or variable, does not really exist and is used for demonstration purposes.

https://en.wikipedia.org/wiki/Foobar
Thanks. Also good quote by Albert Einstein.
 
1 members found this post helpful.
Old 05-28-2020, 12:55 AM   #10
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 885Reputation: 885Reputation: 885Reputation: 885Reputation: 885Reputation: 885Reputation: 885
Quote:
Originally Posted by jefro View Post
I wonder what linux program might be on a CD???

"I have navigated to the program's directory on a CD."
Furthermore, often a CD-rom is mounted with the "noexec" option, so that you cannot run a program directly FROM it.
This is to protect you against malware on the CD.
 
Old 05-28-2020, 02:08 AM   #11
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,847

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Question

Quote:
Originally Posted by nh_linux View Post
Thanks, likewise!

Something else. The youtube hyperlink that u posted has a syntax error. I mention this because after I clicked on the link,my browser's address line displayed " freetube://https://www.youtube.com/watch?v=IVquJh3DXUA ". No wonder why it didn't work the first time. I just edited the url. in address line then it worked. Thanks for this.
If you hover to the link on my post, it starts with https. I am not sure why your browser appended a prefix of freetube.

What browser are you using?
 
Old 05-28-2020, 10:39 AM   #12
nh_linux
LQ Newbie
 
Registered: Jul 2006
Location: In the world! :-)
Distribution: Linux Mint 19.3.
Posts: 25

Rep: Reputation: 1
JJJCR. I'm using Mozilla Firefox version 76. The problem may be on my end. I was running Linux Mint 19.3 XFCE.
 
  


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
how can I run a command on each line of a file eantoranz Programming 6 06-02-2005 03:00 PM
What can/can't run from the command line? redhat beginer Red Hat 4 04-20-2005 11:26 AM
How to run XF86Config from command line Pacemaker Red Hat 2 04-03-2004 05:41 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 09:19 AM
C program code to run a Linux command line Linh Programming 10 06-11-2003 02:59 PM

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

All times are GMT -5. The time now is 05:15 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
Open Source Consulting | Domain Registration