Introduction
MobaXterm is a free, open-source terminal emulator for Windows and Linux that allows users to open an X11 server and execute remote X11 applications on a local machine. It also supports various Unix commands and provides a graphical file transfer interface. One of its notable features is the ability to display colored files in the Linux file manager, such as green executable files and blue directories. However, this feature may not be enabled by default, and some users might face issues with it, especially when not using Singularity containers. In this article, we will explain how to display colored files normally in Linux using MobaXterm without a Singularity container.
Prerequisites
To follow this guide, you should have the following prerequisites:
- MobaXterm installed on your Windows or Linux machine.
- A Linux system accessible via SSH.
Configuring MobaXterm to Display Colored Files
By default, MobaXterm uses the XTerm256 color palette, which should be sufficient to display colored files in Linux. However, if you don't see the colored files, you might need to configure MobaXterm to use the appropriate terminal type and color settings.
Setting the Terminal Type
To set the terminal type, follow these steps:
- Open MobaXterm and connect to your Linux system via SSH.
- Once connected, type the following command in the terminal:
$ stty raw -echo
This command sets the terminal to raw mode, which is necessary for some configurations. After running the command, press Ctrl + Q to exit the terminal and return to the MobaXterm window.
- Now, set the terminal type to xterm-256color:
$ export TERM="xterm-256color"
Setting the Color Palette
If the colored files still don't appear, you might need to set the color palette. To do this, follow these steps:
- Create a new file named ".Xresources" in your home directory:
$ touch ~/.Xresources
Note: If the file already exists, you can edit it instead.
- Edit the file using a text editor like Nano:
$ nano ~/.Xresources
Add the following lines to the file:
xterm.*bgColor: #000000 xterm.*fgColor: #C5C5C5 xterm.*selectedBGColor: #C0C0C0 xterm.*selectedFgColor: #000000 xterm.*scrollBar.background: #C0C0C0 xterm.*scrollBar.foreground: #000000 xterm.*foreground: #C5C5C5 xterm.*background: #000000
Save and close the file.
- Reload the Xresources file:
$ xrdb ~/.Xresources
Testing the Colored Files
After configuring MobaXterm, you should be able to see colored files in the Linux file manager. To test this, create a new directory and add some files with different permissions:
Creating a New Directory and Adding Files
Follow these steps:
- Create a new directory:
$ mkdir test_dir
- Create a new file with executable permissions:
$ touch test_file1
$ chmod +x test_file1
- Create a new file with read-only permissions:
$ touch test_file2
$ chmod 444 test_file2
Verifying Colored Files
To verify that the colored files are displayed correctly, use the MobaXterm file manager:
Using the MobaXterm File Manager
Follow these steps:
- Open the MobaXterm file manager:
$ mxterm -ssh user@your_linux_ip
Replace "user" with your Linux username and "your_linux_ip" with your Linux system's IP address.
- Navigate to the directory:
$ cd ~/test_dir
The MobaXterm file manager should now display the colored files as expected:
In this article, we explained how to display colored files normally in Linux using MobaXterm without a Singularity container. By setting the terminal type and color palette, you can enjoy the benefits of colored files in the Linux file manager.
References