Installing nano, htop, mc - feel better?

As a newborn sysadmin you have already noticed how raw and ascetic could be a console environment and how much time took you to do simple tasks already, especially when you do not feel to powerfull in area of CLI and not knowing the system in a way you want. To make things easier at the present state I explain how to install some aid packages like nano: text-editor, htop: interactive activity monitor and mc: midnight commander  - a filemanager.

 

Nano

Many of you now already think of 'vi' - text-editor I were using in previous tutorials as not only too much complicated  but w.e.i.r.d. - for those of you GNU Nano text editor comes in place.

Type: yum install nano

[root@vps ~]# yum install nano
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: mirror.umd.edu
* extras: mirror.itc.virginia.edu
* rpmforge: mirror.teklinks.com
* updates: centos.mirror.netriplex.com
base
extras
rpmforge
updates
vz-base
vz-updates
15 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nano.i686 0:2.0.9-7.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================
Package Arch Version R
==============================================================================
Installing:
nano i686 2.0.9-7.el6 b

Transaction Summary
==============================================================================
Install 1 Package(s)

Total download size: 431 k
Installed size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
nano-2.0.9-7.el6.i686.rpm
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : nano-2.0.9-7.el6.i686
Verifying : nano-2.0.9-7.el6.i686

Installed:
nano.i686 0:2.0.9-7.el6

Complete!
 

Now if you want to edit i.e. 'mytext.txt' file you simply type: nano mytext.txt

easy nano text editor vps centos

An example of Nano screen.

On the bottom of the screen is a shortcut menu: 

^ means Ctrl on PC (or Cmd on MAC) 

So for example Save & Quit.. you just press Ctrl+x

Ctrl+X Exit the editor. If you've edited text without saving, you'll be prompted as to whether you really want to exit.
Ctrl+O Write (output) the current contents of the text buffer to a file. A filename prompt will appear; press Ctrl+T to open the file navigator shown above.
Ctrl+R Read a text file into the current editing session. At the filename prompt, hit Ctrl+T for the file navigator.
Ctrl+K Cut a line into the clipboard. You can press this repeatedly to copy multiple lines, which are then stored as one chunk.
Ctrl+J Justify (fill out) a paragraph of text. By default, this reflows text to match the width of the editing window.
Ctrl+U Uncut text, or rather, paste it from the clipboard. Note that after a Justify operation, this turns into unjustify.
Ctrl+T Check spelling.
Ctrl+W Find a word or phrase. At the prompt, use the cursor keys to go through previous search terms, or hit Ctrl+R to move into replace mode. Alternatively you can hit Ctrl+T to go to a specific line.
Ctrl+C Show current line number and file information.
Ctrl+G Get help; this provides information on navigating through files and common keyboard commands.

htop

This is a simillar to Linux built-in process viewer (command: 'top') but the process data is presented and controlled in a clear and easy way. Windows users can think of it as a 'task manager' window - and they know how important it is on a daily basis. Htop gives not only information about running tasks but also an accurate information on CPU core/s usage, Memory (RAM) /Swap usage, number of tasks/threads running, important Load Average info and server uptime, what is important the process list is active - controlled by keyboard cursors.

htop vps centos process viewer

 

Need rpmforge repo!

You need rpmforge repository installed on your CentOS server, installation process is described in this previous post.

For install type: yum install htop

[root@vps ~]# yum install htop
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.mirror.constant.com
* extras: mirror.itc.virginia.edu
* rpmforge: mirror.teklinks.com
* updates: centos.mirror.netriplex.com
15 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package htop.i686 0:1.0.2-1.el6.rf will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================
Package Arch Version Repository Size
==============================================================================
Installing:
htop i686 1.0.2-1.el6.rf rpmforge 78 k

Transaction Summary
==============================================================================
Install 1 Package(s)

Total download size: 78 k
Installed size: 186 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.2-1.el6.rf.i686.rpm | 78 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : htop-1.0.2-1.el6.rf.i686 1/1
Verifying : htop-1.0.2-1.el6.rf.i686 1/1

Installed:
htop.i686 0:1.0.2-1.el6.rf

Complete!
[root@vps ~]#
 
And to run, simply type: htop
 

mc - midnight commander

Many of you heard about Norton Commander for MS-DOS, many of you MS users heard about Total Commander or even Directory Opus - they are so called file-managers and the fact is since you install any first file-manager you can't live without it. 

mc midnight commander

Midnight Commander screen

As in any filemanager the idea is simple: two windows (left and right), one active at a time, active is a 'source' another is a 'destination'. And you can do things not only as seen on a bottom menu but much much more (but that's for another tutorial). So you can simply copy selected files and directories (F5), move (F6) and delete (F8) .. you can view files (F3) and edit them (F4).. feel free to hit F1 for more help.

To install type: yum install mc

[root@vps ~]# yum install mc
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.mirror.constant.com
* extras: mirror.itc.virginia.edu
* rpmforge: mirror.teklinks.com
* updates: centos.mirror.netriplex.com
15 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mc.i686 1:4.7.0.2-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================
Package Arch Version Repository Size
==================================================================
Installing:
mc i686 1:4.7.0.2-3.el6 base 1.6 M

Transaction Summary
==================================================================
Install 1 Package(s)

Total download size: 1.6 M
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
mc-4.7.0.2-3.el6.i686.rpm | 1.6 MB 00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:mc-4.7.0.2-3.el6.i686 1/1
Verifying : 1:mc-4.7.0.2-3.el6.i686 1/1

Installed:
mc.i686 1:4.7.0.2-3.el6

Complete!
[root@vps ~]#
 

 

Hope your life will be easier now :-)