Try MC it is extremely very good for GUI in Ubuntu and Debian
Midnight Commander (MC)
You may need to install the Midnight Commander package which is titled "
mc
" by the following.$ sudo apt-get install mcUse the mc(1) command to explore the Debian system. This is the best way to learn. Please explore few interesting locations just using the cursor keys and Enter key.
- "
/etc
" and its subdirectories - "
/var/log
" and its subdirectories - "
/usr/share/doc
" and its subdirectories - "
/sbin
" and "/bin
"
In order to make MC to change working directory upon exit and
cd
to the directory, I suggest to modify "~/.bashrc
" to include a script provided by the mc
package.. /usr/lib/mc/mc.shSee mc(1) (under the "
-P
" option) for the reason. (If you do not understand what exactly I am talking here, you can do this later.)
MC can be started by the following.
If you encounter character encoding problem which displays garbage characters, adding "
If this doesn't clear up your display problems with MC, see Section 9.6.6, “The terminal configuration”.
$ mcMC takes care of all file operations through its menu, requiring minimal user effort. Just press F1 to get the help screen. You can play with MC just by pressing cursor-keys and function-keys.
Note | |
---|---|
In some consoles such as gnome-terminal(1), key strokes of function-keys may be stolen by the console program. You can disable these features by "Edit" → "Keyboard Shortcuts" for gnome-terminal . |
-a
" to MC's command line may help prevent problems.If this doesn't clear up your display problems with MC, see Section 9.6.6, “The terminal configuration”.
The default is two directory panels containing file lists. Another useful mode is to set the right window to "information" to see file access privilege information, etc. Following are some essential keystrokes. With the gpm(8) daemon running, one can use a mouse on Linux character consoles, too. (Make sure to press the shift-key to obtain the normal behavior of cut and paste in MC.)
Table 1.11. The key bindings of MC
key | key binding |
---|---|
F1 | help menu |
F3 | internal file viewer |
F4 | internal editor |
F9 | activate pull down menu |
F10 | exit Midnight Commander |
Tab | move between two windows |
Insert or Ctrl-T | mark file for a multiple-file operation such as copy |
Del | delete file (be careful---set MC to safe delete mode) |
Cursor keys | self-explanatory |
cd
command changes the directory shown on the selected screen.Ctrl-Enter
orAlt-Enter
copies a filename to the command line. Use this with cp(1) and mv(1) commands together with command-line editing.Alt-Tab
shows shell filename expansion choices.- One can specify the starting directory for both windows as arguments to MC; for example, "
mc /etc /root
". Esc
+n-key
→Fn
(i.e.,Esc
+1
→F1
, etc.;Esc
+0
→F10
)- Pressing
Esc
before the key has the same effect as pressing theAlt
and the key together.; i.e., typeEsc
+c
forAlt-C
.Esc
is called meta-key and sometimes noted as "M-
".
The internal editor has an interesting cut-and-paste scheme. Pressing
This editor can be directly started on a file using one of the following commands.
This internal editor can be replaced with any external editor of choice.
Also, many programs use the environment variables "
If you are uncomfortable with vim(1), you can keep using mcedit(1) for most system maintenance tasks.
F3
marks the start of a selection, a second F3
marks the end of selection and highlights the selection. Then you can move your cursor. If you press F6, the selected area is moved to the cursor location. If you press F5, the selected area is copied and inserted at the cursor location. F2
saves the file. F10
gets you out. Most cursor keys work intuitively.This editor can be directly started on a file using one of the following commands.
$ mc -e filename_to_edit
$ mcedit filename_to_editThis is not a multi-window editor, but one can use multiple Linux consoles to achieve the same effect. To copy between windows, use Alt-F<n> keys to switch virtual consoles and use "File→Insert file" or "File→Copy to file" to move a portion of a file to another file.
This internal editor can be replaced with any external editor of choice.
Also, many programs use the environment variables "
$EDITOR
" or "$VISUAL
" to decide which editor to use. If you are uncomfortable with vim(1) or nano(1) initially, you may set these to "mcedit
" by adding the following lines to "~/.bashrc
".export EDITOR=mcedit export VISUAL=mceditI do recommend setting these to "
vim
" if possible.If you are uncomfortable with vim(1), you can keep using mcedit(1) for most system maintenance tasks.
MC is a very smart viewer. This is a great tool for searching words in documents. I always use this for files in the "
/usr/share/doc
" directory. This is the fastest way to browse through masses of Linux information. This viewer can be directly started using one of the following commands.$ mc -v path/to/filename_to_view
$ mcview path/to/filename_to_view
Press Enter on a file, and the appropriate program handles the content of the file (see Section 9.5.11, “Customizing program to be started”). This is a very convenient MC feature.
In order to allow these viewer and virtual file features to function, viewable files should not be set as executable. Change their status using chmod(1) or via the MC file menu.
Table 1.12. The reaction to the enter key in MC
file type | reaction to enter key |
---|---|
executable file | execute command |
man file | pipe content to viewer software |
html file | pipe content to web browser |
"*.tar.gz " and "*.deb " file | browse its contents as if subdirectory |
In order to allow these viewer and virtual file features to function, viewable files should not be set as executable. Change their status using chmod(1) or via the MC file menu.
MC can be used to access files over the Internet using FTP. Go to the menu by pressing
F9
, then type "p
" to activate the FTP virtual filesystem. Enter a URL in the form "username:passwd@hostname.domainname
", which retrieves a remote directory that appears like a local one.Starting a program from GUI
You can set up to start a process from graphical user interface (GUI).
Under GNOME desktop environment, a program can be started with proper argument by double-clicking the launcher icon, by drag-and-drop of a file icon to the launcher icon, or by "Open with …" menu via right clicking a file icon. KDE can do the equivalent, too.
Here is an example under GNOME to create a launcher icon for mc(1) started in gnome-terminal(1).
Create an executable program "
mc-term
" by the following.# cat >/usr/local/bin/mc-term <<EOF #!/bin/sh gnome-terminal -e "mc \$1" EOF # chmod 755 /usr/local/bin/mc-term
Create a desktop launcher as the following.
- Right click desktop space to select "
Create Launcher …
". - Set "Type" to "
Application
". - Set "Name" to "
mc
". - Set "Command" to "
mc-term %f
". - Click "OK".
Create an open-with association as as the following.
- Right click folder to select "
Open with Other Application …
". - Click open "Use a custom command" dialog and enter "
mc-term %f
". - Click "Open".
No comments:
Post a Comment