LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-05-2013, 02:01 PM   #1
DextrousDave
LQ Newbie
 
Registered: Jul 2013
Posts: 16

Rep: Reputation: Disabled
sudo: nano: command not found on CentOS


Hi All

I have just started using my new VPS running on CentOS6.

Now I have followed this tutorial on how to install LAMP so that I can run my website on the server.

https://www.digitalocean.com/communi...ck-on-centos-6

Problem:

When I want to run the following command:
sudo nano /var/www/html/info.php
the terminal tells me:
sudo: nano: command not found

What do I need to fix that?

Thanks!
 
Old 07-05-2013, 02:13 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Why not think about it for a minute? "<command> not found". This means that it's not installed, isn't located in a preset PATH location, or perhaps not executable for some reason, such as permissions. Like most general use programs, nano is usually installed to /usr/bin.

Of course you don't need nano. You can substitute whatever text editor you want to use instead.
 
Old 07-05-2013, 02:29 PM   #3
DextrousDave
LQ Newbie
 
Registered: Jul 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thank you David. It might be obvious to you, since you are a "Bash Guru" - But you're right, I just thought that something went wrong. I have never worked with Linux before, so I am VERY novice at it...

Ho do I call it from its dir then - /usr/bin ?

What other text editor can I use and how do I call it?

Thank you for taking the time to answer...
 
Old 07-05-2013, 02:53 PM   #4
DextrousDave
LQ Newbie
 
Registered: Jul 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
OK cool...I found it by using some grey matter...
sudo yum install nano...

Amazing what a little thinking can do hey.

thanks!
 
Old 07-07-2013, 06:26 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Sometimes it just takes a nudge. Glad I could set you on the right course.


As you can suspect there are any number of editors available. Search yum and the web and try some out. You'll probably want to stick to a cli version though, since you're using sudo, and it can be a bit tricky to get a gui editor running in another user's x-session.

My personal recommendation is vim, if you have the gumption to tackle it. It has a steep, steep learning curve, but the view from the top makes the effort very worthwhile. It's one of the granddaddies of *nix text editing, along with emacs, and there's a long-running rivalry between them.

Vim Creep (a motivating essay)
A Byte of Vim (a good tutorial)
vimtutor (shell command that launches an interactive tutorial)
 
  


Reply



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
sudo slackpkg = command not found gabrielmagno Slackware 10 06-22-2013 05:41 AM
sudo cd /root gives 'sudo: cd: command not found'. stf92 Linux - Newbie 4 03-03-2012 09:05 AM
[SOLVED] sudo ... command not found PlatformIndependentBoy Linux - Server 7 08-06-2010 12:44 PM
sudo: shutdown: command not found ekdya Fedora 2 09-29-2006 04:42 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:32 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