Upload a File to Fedora Using Midnight Commander

Community Web log How to Manage Files Visually on Linux with Midnight Commander

How to Manage Files Visually on Linux with Midnight Commander

In this tutorial, nosotros'll show you how y'all can install Midnight Commander to enable a simplified visual management of your files on a Linux server.

By Alexandru Andrei, Alibaba Cloud Community Blog author.

If yous occasionally manage files on your Linux server(s), commands such as cp, mv, rm, mkdir or the more avant-garde ones like rsync are often enough to get the job done. However, if the work you lot practise on your server constantly requires you lot to deal with various files and directories, it may be worthwhile to use an utility that can make your task much simpler (and faster).

When yous scan your disks on the Windows operating system, you use the file Explorer programme, which makes it very easy to visualize the construction of your directories and the files they comprise. It as well makes it easy to copy or move files around, delete them, create directories, and so on, with a few mouse movements and clicks, or by using keyboard shortcuts such every bit CTRL+C and CTRL+5. The utility called Midnight Commander runs on whatever Linux system and tin assist yous in a very similar fashion. Just while Explorer is a GUI (Graphical User Interface) application, Midnight Commander sits somewhere in the middle, between the CLI (Command Line Interface) and a GUI utility. Since it has to work within the constraints of your SSH session, which is text-based, this is a TUI (Text User Interface) program. While the name may audio fancy, it simply means that this utility creates a visual interface out of text elements instead of pixels, pictures, fancy menus with 3D shadows and so on. It does this past using characters that you lot can usually find on your keyboard, just like the following characters create an image of a rabbit when viewed from a distance.

                                  / \     / _ \    | / \ |    ||   || _______    ||   || |\     \    ||   || ||\     \    ||   || || \    |    ||   || ||  \__/    ||   || ||   ||     \\_/ \_/ \_//    /   _     _   \   /               \   |    O     O    |   |   \  ___  /   |  /     \ \_/ /     \ /  -----  |  -----  \ |     \__/|\__/     | \       |_|_|       /  \_____       _____/        \     /        |     |              

How to Install Midnight Commander

To install Midnight Commander on Ubuntu or Debian, every bit the root user, run

                apt install mc                              

If you don't unremarkably log in as root for administrative tasks, merely instead utilize a regular user with sudo privileges, and so but prefix the command with sudo, for case: sudo apt install mc.

Similarly, if y'all intend to install Midnight Commander on CentOS or RedHat, run

                yum install mc                              

On a SUSE distribution, install with

                zypper install mc                              

How to Use Midnight Commander

If you don't need root user's privileges to work with your files and directories, it'south recommended yous log in as a regular user before starting Midnight Commander. This tin help yous avoid accidentally modifying, moving or removing operating organization files and directories.

To launch the utility, enter the following command.

                mc                              

In the next picture, you can see how the program's chief window looks like. The text with the ruby colour has been added on top of the screenshot to highlight the main interface elements/areas.

1

Midnight Commander'south Interface Elements

  • The top menu which is like the carte of whatsoever other graphical application you've used. Here, you can select the deportment yous want to perform on files/directories, modify how you view directory contents, adjust program settings so on.
  • The left pane and the right pane make it easier to copy and move files/directories around. When y'all start a copy/move operation on an element in the left pane, it will be copied/moved to the directory that is currently open up in the right pane. The same applies if you offset a copy or motility performance from the right pane, it volition be sent to the directory that you are currently viewing in your left pane.
  • At the bottom you can meet the usual control line/prompt (user@alibaba:~$ in the flick above). Here, you can type the aforementioned commands you can apply in a typical SSH session. They will be executed in the directory that is currently open in the active pane (you can change panes with the TAB key). To see command output, press CTRL+o (the letter "o", not the digit goose egg). When you exercise this, it may seem that Midnight Commander has quit, but it's still running; to go back to its interface, press CTRL+o once more.
  • Finally, y'all have the action buttons/function keys at the bottom of the screen. These stand for what the F keys on your keyboard volition practise, if pressed. For example, you tin see that "Copy" is preceded by the number "5", which means that if y'all press the F5 key on your keyboard, you will start a copy functioning on the file/directory that is currently highlighted in the agile pane.

Mouse Back up

Depending on what SSH customer you apply to connect to your Linux (or BSD) ECS example, you may be able to use your mouse to collaborate with interface elements in Midnight Commander. For instance, if you connect from Windows, using PuTTY, then you can click on the bottom menu buttons, carte items in the top, dialog options (for example, OK buttons), files/directories you can encounter in the left and right panes, so on. The same is true if you connect from Linux, using the preinstalled OpenSSH customer.

Using your mouse to interact with the file browsing utility as well makes it easier to select multiple files/directories y'all want to work with. You tin can right click on a bunch of files to select them, which will highlight them in xanthous. Then, by pressing F5, you can copy all the selected entries to some other location. Of class, you can also press F6 to move them, F8 to delete them or go through the card to perform some other activity on your selections.

If the files/directories you want to select are adjacent to each other, yous can concur the right mouse button and drag downwards or up to highlight them.

How to Use Midnight Commander'south Left and Right Panes

The first thing y'all ordinarily exercise in any of the panes is navigate to your desired directory. By using the arrow keys, select the directory you wish to "enter" and printing the ENTER key. If you accept mouse support, simply double-click on the entry you wish to navigate to. Besides going into a directory, you tin besides become "out" of it, going one level up. To practice so, select the first entry /.. and press ENTER (or double click it). If, for instance, yous are currently in the directory /abode/user/webapp, this will accept you lot into /home/user/.

To switch from the right pane to the left pane, or vice versa, press TAB.

Selecting Multiple Files and Directories

If you lot intend to work with a unmarried entry (file or directory), only navigate to it with the upwardly and down pointer keys and then select the desired action (due east.g., re-create, motion, delete). Sometimes, however, y'all volition want to act on multiple entries at once. You can select multiple files and directories with the mouse, every bit instructed in the "Mouse Back up" department above. Otherwise, with your keyboard, yous have the following options to make selections:

  • Navigate to your desired entry and once it's highlighted, printing INSERT to select it. Navigate to other entries you desire to select and echo the same action.
  • Lucifer files and directories against a design: Press the + sign on your keyboard (the one on the numerical keypad is more comfortable to use every bit you don't have to concur down the SHIFT fundamental to access information technology). Hither, type the blueprint of the selection you want to make. To select all files, type * and printing ENTER. To deselect, just press - instead and and so type your blueprint.

The * character in a pattern is a wildcard that replaces zero or more characters. For example *.html will match all files/directories that stop in ".html" and file* will friction match all files and directories that begin with the string of characters "file" like "file1", "file2", "file1234" but too "file". Finally, something such as *mm* will match entries like "command" or "mmemory" or "himemm" or fifty-fifty "mm" itself.

Some other special symbol is ? which is a wildcard for a single character. For case, "file?" will match "file1", "file2", "file9", "files", but will non match "file" or "file12".

2

  • Printing * to invert selection. If you initially have nothing selected, this will add all files and directories to the selection in your active pane. This is oft useful when you want to exclude something from the entries you lot want to group. Say you desire to select all files, from 1 to 100, except seven and 8. It would be ho-hum to press INSERT on all files, from 1 to vi and then from 9 to 100. So what you lot do instead is select seven and viii with your INSERT key and then press * on your keyboard to invert selection. Now all files volition be selected, with the exception of 7 and 8.

How to Use Midnight Commander's Activity Buttons (Part Keys)

Most of the times, y'all will want to view and edit files, copy, move or rename them, create directories, delete entries and and so on. Since these deportment are used most often, you have them mapped to your function keys, from F3 to F8, as you tin encounter in the bottom of the screen.

Here'due south an example where an entry has been selected in the left pane and then F5 was pressed to copy the directory.

3

A prompt appears in case you want to change some copy parameters. Usually, you just go with the defaults and just press ENTER at this prompt to kickoff the re-create performance. Yet, if you do want to change something, here's how y'all can interact with these interface elements.

Navigating Dialog Options:

  • If you have mouse support, the easiest style is to but click on the desired field, pick or button.
  • To bound to the side by side input field, selectable option or push button, printing the TAB primal. If it's a toggle switch that you can turn on and off, press Infinite to cheque or uncheck it (plow it to [x] or [ ])
  • Use the directional arrow keys to bound to the desired option. Aforementioned as higher up, press SPACE to check or uncheck an on/off option.
  • Some letters are highlighted, indicating a keyboard shortcut that y'all can use to quickly access the corresponding chemical element. For example, in the picture above, the button titled "Cancel" has the "C" letter of the alphabet highlighted. This means that past pressing ALT+C yous can "click" on that button. Same applies for all of the other highlighted letters, just press ALT and the corresponding alphabetic character.

F1 - volition testify you lot contextual assistance. What this means is that it displays a different help dialog, depending on the context that is currently open. For instance, if you're using Midnight Commander's editor and printing F1, it will show you the assist page for the editor. If you accept a dialog window open that shows you some parameters for a copy functioning, like in the paradigm to a higher place, and press F1, it volition display a assist folio that explains the options in that dialog box. Go out help with the ESC key (press ESC twice if it doesn't work when pressing once).

F2 - displays a contextual carte (like a right click in the Windows operating system). Depending on what kind of file or directory you lot select, information technology will show a different carte du jour, with deportment that are appropriate for that type of entry/entries. These are usually short scripts (concatenation of commands and/or atmospheric condition) that you can execute on entries. Some actions from this menu may not work, if your distribution doesn't include necessary packages (for instance, 7zip utility non included, and then you lot can't create .7z archives) or Midnight Commander has been packaged with some bugs/quirks. Test the desired activity on unimportant files/directories first to encounter if they piece of work every bit intended.

Midnight Commander has an integrated file viewer. Printing F3 to view whatever text file. Afterwards, press F10 to quit. In some cases, depending on your SSH customer, F10 might be mapped to another action. Instead of sending the action key input to Midnight Commander, information technology might be caught by your SSH client, which might display its bill of fare or practise another action mapped to the F10 key. In such a case, you tin too quit the viewer past pressing ESC (press twice if once doesn't work).

The F6 and F7 activity keys may not be immediately obvious as to what they practise. F6, titled "RenMov" is used to rename or motion a file to a unlike location. F7, "Mkdir" is used to create (make) a directory.

The file editor can be accessed with F4. In most cases, this will invoke the organization default editor on your system (separate utility from Midnight Commander). In the case of Debian or Ubuntu, this will be the "nano" utility. To quit this, press CTRL+10. If you modified the file open in the editor and want to relieve it, printing CTRL+X and then release the CTRL key, press y, followed past ENTER.

Switching Default Organization Editor

If you're presented with the following output the first time you edit a file,

                Select an editor.  To change later, run 'select-editor'.   1. /bin/nano        <---- easiest   two. /usr/bin/mcedit   3. /usr/bin/vim.tiny   4. /bin/ed  Choose i-4 [1]:                              

You lot can choose the mcedit editor if you want to, which is the built-in editor from Midnight Commander, that y'all may detect easier to use than nano. If you've been presented with this choice carte du jour in the by and already picked nano, you tin modify your choice by outset deleting this file (enter this command):

                rm ~/.selected_editor                              

Next, press F4 in Midnight Commander to edit a file. You will be shown the menu above, once again, and you tin can pick a dissimilar selection.

In the mcedit editor, you can likewise access the top menu, which is subconscious past default, past pressing F9. To acquire how to navigate this menu, read the next section below, since the same rules employ, even if it'due south a different menu.

How to Apply Midnight Commander'south Pinnacle Carte

While you can access the nearly common actions with your F3 to F8 keys, more complex or special deportment will accept to be accessed through the height menu. To enter the superlative bill of fare, or rather, "pull down", as information technology's called in the file utility, press F9. Afterwards, printing the DOWN pointer fundamental to brandish the highlighted card choice. With the Upwardly, DOWN, LEFT and Right pointer keys you can navigate through all menu entries. Just as instructed in the previous section almost navigating dialog options, you can speedily access card entries by pressing ALT and the respective highlighted letter. For instance, as seen in the next image, past pressing ALT+h, y'all can access the "Chmod" pick from the menu to change file permissions.

4

Side by side to the "Chmod" menu entry you can meet a string of characters, "C-x c". This indicates a sequence of keys that y'all can press to quickly access the option without having to fifty-fifty open the bill of fare. "C-" indicates the CTRL key. So, by pressing CTRL+X, releasing the CTRL cardinal and then pressing c, you can open the Chmod dialog option to modify file permissions.

On other menu entries, y'all volition see something like "One thousand-c". "M" stands for meta key, in this case, information technology is the ALT key on your keyboard. So, by pressing ALT+c, you tin can open upwardly a "quick change directory" dialog option.

Conclusion

Information technology'south worth mentioning that this utility supports browsing some types of athenaeum. Press enter on such a file, and if MC can open up it, it volition prove upwardly just equally a regular directory, allowing yous to extract 1 or more than files/directories, or read them in the integrated viewer.

Nosotros hope that with the knowledge from this article you can make Midnight Commander your own. Don't exist intimidated past the multitude of options the plan has. Y'all only accept to learn the parts that you lot need for your usual work.

Alibaba Clouder

2,630 posts | 670 followers

Follow

You may likewise like

Comments

Alibaba Clouder

2,630 posts | 670 followers

Follow

Related Products

  • ECS(Elastic Compute Service)

    An online computing service that offers elastic and secure virtual cloud servers to cater all your deject hosting needs.

    Learn More
  • OSS(Object Storage Service)

    An encrypted and secure cloud storage service which stores, processes and accesses massive amounts of data from anywhere in the world

    Learn More

sextonwasing.blogspot.com

Source: https://www.alibabacloud.com/blog/how-to-manage-files-visually-on-linux-with-midnight-commander_595865

0 Response to "Upload a File to Fedora Using Midnight Commander"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel