LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   sudo: nano: command not found on CentOS (https://www.linuxquestions.org/questions/linux-server-73/sudo-nano-command-not-found-on-centos-4175468616/)

DextrousDave 07-05-2013 02:01 PM

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!

David the H. 07-05-2013 02:13 PM

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.

DextrousDave 07-05-2013 02:29 PM

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...

DextrousDave 07-05-2013 02:53 PM

OK cool...I found it by using some grey matter...
sudo yum install nano...

Amazing what a little thinking can do hey.

thanks!

David the H. 07-07-2013 06:26 AM

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)


All times are GMT -5. The time now is 10:22 AM.