Linux's Articles

Linux is a open source Unix-like operating systems based on the Linux kernel, an operating system. Learn more about Linux tutorials online and hacks.

Choosing the right Linux distribution for your VPS
VPS hosting services are the perfect alternatives of dedicated hosting. Many enterprises leverage VPS hosting to scale their websites and applications. If you're considering setting up a Virtual Private Server (VPS) for your website or application, one of the first decisions you'll need to make is which Linux distribution (operating systems) to use. With so many options available, it can be overwhelming to choose the right one for your needs. In this blog post, we'll explore the most popular Linux distributions for Linux VPS hosting and help you make an informed decision. Let's dive deeper into understanding what a Linux distribution is. A distribution, or "distro" for short, is a collection of software that's built on top of the Linux kernel. Each distro has its own set of features, tools, and configurations that make it unique. Some distros are designed for specific use cases, such as servers, desktops, or embedded systems, while others are more general-purpose. When it comes to VPS hosting, there are a few factors to consider when choosing a Linux distribution: Security: Talking about one of the prominent advantages of linux VPS hosting, the security of your VPS is critical, especially if you're storing sensitive data or processing payments. With MilesWeb’s Linux VPS hosting, users will get top-notch security in the form of SSL certificates (to secure domain’s information) and managed support to monitor server resources. Here is a table given below to highlight its competitive features and pricing. Performance: VPS hosting is all about performance, so you'll want a distro that's optimized for speed and efficiency. MilesWeb’s VPS hosting offers 99.95% uptime with minimal latency.  Ease of use: While Linux has a reputation for being complex, some distros are more user-friendly than others. If you're new to Linux, you may want to choose a distro that has a more intuitive interface. In fact, MilesWeb’s VPS servers include cPanel and Plesk control panels that makes it easier for users to manage their domains.  Support: If you run into issues with your VPS, you'll want to be able to get help quickly. Choosing a distro with human technical support options can help ensure that you have assistance with the issues you are facing. With those factors in mind, let's take a closer look at some of the most popular Linux distributions for VPS hosting: Ubuntu Ubuntu is one of the most popular Linux distros out there, and for a good reason. It's user-friendly, well-supported, and has a large community of users and developers. Ubuntu releases new versions every six months, which means you'll always have access to the latest security updates and features. Additionally, Ubuntu is based on Debian, another popular Linux distribution, so it benefits from the extensive testing and development that goes into that distro. One potential downside of Ubuntu is that it can be resource-intensive, which may impact performance on smaller VPS instances. However, Ubuntu also offers a lightweight version called Ubuntu Server, which is optimized for servers and can run on lower-end hardware. Debian Debian is one of the oldest and most stable Linux distributions available. It's known for its robust security features and long-term support, making it a popular choice for servers and other mission-critical applications.Debian is focused on stability, therefore it may not always have the latest features or packages available, which may be a concern if you need bleeding-edge software. A potential downside of Debian is that it can be less user-friendly than some other distros. If you're new to Linux or don't have much experience with command-line interfaces, you may find Debian to be challenging to work with. CentOS CentOS is a community-driven Linux distribution that's based on Red Hat Enterprise Linux (RHEL). It's designed to be stable and secure, with a focus on enterprise-level features and support. Because CentOS is based on RHEL, it benefits from the extensive testing and development that goes into that commercial distribution. Additionally, CentOS offers a minimal install option that's optimized for servers and can run on lower-end hardware. Conclusion Choosing the right Linux distribution for your VPS hosting depends on a number of factors, including security, performance, ease of use, and support. Ubuntu, Debian, CentOS, Fedora, and Arch Linux are all popular choices that offer different benefits and trade-offs. Ultimately, the best distro for you will depend on your specific needs and preferences. When choosing Linux distribution, it's important to do your research and consider your options carefully. Look for a distro that's well-maintained, has a large community or commercial support options, and is optimized for the specific use case of VPS hosting. By researching well for choosing the right Linux distribution for your VPS, you can ensure that you have a secure, fast, and reliable platform for your website or application.
Best Image Editor Software for Linux
In recent times, Linux has become more rich in terms of softwares availability. Today, there are so many alternative software avaialable compared to Windows like LibreOffice. Also, many software developers are making softwares for Windows as well as Linux. If you are new to Linux or have recently migrated to Linux from Windows, then you might be confused with some of your basic required softwares. Also you are looking for alternative Image editor softwares than Windows operating system as Photoshop is not available for Linux. So here is the some of the best Image editing softwares from my point of view. 1. GIMP GIMP or GNU Image Manipulation Program is the most popular and open-source photo editor software for Linux as well as Windows and MacOS. GIMP is the advance image editor software to make professional level editing. GIMP is the highly customizble and You can also use third party plugin and can enhance the power of GIMP. You can download GIMP directly from Official Website or Ubuntu Software Center or from the Terminal bu running bellow command. sudo apt-get install gimp 2. Pinta Pinta is simple and fast drawing open-source bitmap image editor for Linux, Windows, Mac and BDS operating systems. It has simple drawing tools, editing and manipulating images compared to other open-source editor GIMP. It is much like Paint application of the Linux. Download Pinta from official Pinta download page or Ubuntu Software Center. You can also install Pinta from Terminal with 3rd party repository with bellow command. sudo add-apt-repository ppa:pinta-maintainers/pinta-stable sudo apt-get update sudo apt-get install pinta 3. Inkscape Inkscape is also open-source and professional quality vector graphics editor runs on Linux, MacOS and Windows computers. Inkscape is useful in creating and editing vector graphics like diagrams, charts, logos etc. You can download and install Inkscape from official website or Ubuntu Software Center or from the Terminal with bellow commands. sudo add-apt-repository sudo apt-get update && sudo apt-get install inkscape 4. Darktable Darktable is open-source and raw image editor application available for Linux, Windows, MacOS, and FreeBDS etc. Darktable creates virtual lighttable and darkroom for raw images which manage their digital negatives in a database. You can download Darktable from officel website or directly from the Terminal with bellow command. sudo add-apt-repository ppa:pmjdebruijn/darktable-release sudo apt-get update && sudo apt-get install darktable 5. RawTherapee RawTherapee is a raw photo processing system, processing photographs. RawTherapee is the image editing softwares specifically aimed at non-destructive post-production of raw photos. RawTherapee is written mostly in C++ using a GTK+ front-end. The RawTherapee is useful for enthusiast newcomers who wish to broaden their understanding of how digital imaging works to semi-professional photographers. Download and install RawTherapee from officel website or directly from the Terminal with bellow command. sudo add-apt-repository ppa:dhor/myway sudo apt-get update && sudo apt install rawthreapee 6. Krita Krita is simple and powerful open-source image editor software available for Linux, Windows and MacOS. Krita is designed primarily for digital painting and animation purposes. You can download Krita directly from Official Website or Ubuntu Software Center or from the Terminal bu running bellow command. sudo add-apt-repository ppa:kritalime/ppa sudo apt update sudo apt install krita Other options If you don't like any of Linux Image editor or you don't want to change software that you have used in Windows and also you wants to stick with Linux operating system, then you can try Wine. Wine is popular Linux software that lets you to run many Windows application on Linux including high end games, Adobe Photoshop or Adobe After Effects. You can download Wine from the official Wine download page. We will discuss more about Wine in next article. Conclusion We have only included some of the most popular and best image editor softwares. There are so many other softwares also available which are more powerful also. If you have used that, please share it in the bellow comment section. Thank you for reading the article.
How to Install and Use Nano Text Editor in Linux
Many times, working in command line, many times we have to create and edit files. Also working in the server by ssh, we also need to create and edit files. There are many command line text editor available to do these type of work. Vim and Emacs are the most popular command line text editor but they are difficult for the new users. There is also one text editor available for that. Nano or GNU Nano is a simple and user friendly text editor for Unix and Linux systems which provides command line interface. Nano provides all basic features like text editing, search and replace, go to line and column number, auto-indentation, feature toggles and filename tab completion. Most of hosting providers and linux distribution comes preinstalled with Nano text editor. In this article, we will discuss on how to install and use Nano text editor in Linux. Before we start, make sure you have basic knowledge of Terminal or CMD. If you are working in remote server, make sure you have already connected with server through ssh connection. Install Nano text editor Nano text editor comes pre-installed on macOS and most Linux distros. If you want to check if it is installed on your system or not, use this command. nano --version You will see bellow response, if you have already Nano text editor installed. You can also install Nano text editor with bellow commands. Debian based Linux system sudo apt-get install nano Fedora and CentOS Linux system sudo yum install nano Basic commands Most of commands for Nano text editor are like: nano [OPTION]... [FILE] To create or edit existing files, use bellow command. nano /path/to/file/file.txt If file is already exist, it will open for edit, other wise new file will create when you save the file. Run the command nano in the Terminal and bellow window will appear. At the bottom of the window, there are some shortcuts available. All the shortcuts with ^ (caret) signs indicates CTRL or CMD key while some shortcuts with M- (Meta key) indicates ALT key. Here are some Standard commands for Nano text editor: CTRL + G shortcut displays all shortcuts and help text. If you want to find some text, first press CTRL + W key, then input the search keyword. Press ENTER to find the first matched text. Then press ALT + W to go to next matched text. To replace text, first press CTRL + \ to enter the text that you want to replace with keyword and hit ENTER. This will ask to replace the first matched text with Y or N key. To select the text, first press ALT + A key, this will start selecting. Now press ARROW KEYS to move the cursor to select text and then press ALT + 6 key to copy or CTRL + K to cut the selected text. Press CTRL + U to paste the copies text. Press CTRL + _ to go the specific number line. To save the file with changes, press CTRL + O. If you want to exit Nano text editor, press CTRL + X shortcut. If there are some changes, it will ask to save changes with Y or N option. CTRL + C to get Cursor's current position or cancel the current active shortcut. If you want to scroll to the next page, press CTRL + Y or previous page with CTRL + V. There are also some options you can pass to do following changes. -B     Backup file befor editing the file. -E     Converts tabs to spaces while editing -R     Don't read or write to any file not specified on the command line; -S     Text will scroll line-by-line instead of page -i     Automatic indentation -c     Continously display cursor position -t   Don't ask to save file before exiting.   Conclusion This is the basic shortcuts you can use the GNU nano text editor. For more information about Nano visit the official nano documentation page. I hope this article will help you. Also if you have any question, feel free to comment in the bellow comment section.
How to Use wget Command With Examples
Wget is free and cross-platform command-line tool created by the GNU Project for downloading files from the web. It downloads files via protocols like FTP, SFTP, HTTP, and HTTPS. It supports multiple files downloading, downloading in the background, resuming downloads, recursive downloading, limiting the bandwidth for downloads and viewing headers. Wget is available to install in Linux, Unix and Windows system. In this article, we will show you how to install and use the Wget command. We will also use some useful Wget command examples. Install Wget Wget tool comes pre-installed in most Linux distributions. You can check whether it is installed on your system, open Terminal or CMD, type wget and press enter. It will print bellow output. laravelcode@Lenovo-G50-70:~$ wget wget: missing URL Usage: wget [OPTION]... [URL]... Try `wget --help' for more options. If wget command is not installed in your system, you can easily install it directly from the command-line. To install wget on Ubuntu or Debian, execute the following command: sudo apt-get install wget To install wget on Fedora or CentOS, use the bellow command: sudo yum install wget Download files via wget The basic syntax to download files is as bellow: wget [options] [url] Where [options] are how you want to download the files and [url] is the remote file path. There are many ways you can download files via wget. Here is some useful options you can use to download files over the internet. Download single file This is the basic wget command that is used most. For example, download latest Ubuntu 18.04 LTS ISO file using bellow command. wget Download file with different name You can also download file with different name. Pass -O option in the command with new name. In the bellow example, file will be saved as ubuntu.iso. wget -O ubuntu.iso Download file to different folder You can download file direct to other folder by passing -P option with directory path. In the bellow command file will be stored in Documents folder. wget -P ~/Documents Download multiple files You can download multiple files at a once. For that, create new txt file and put all files link in that txt file. Here is my text document file which download multiple files at a once. files.txt After text document created, you can use -i to get all the files stored in your text file:  wget -i ~/Downloads/files.txt Download resumable file While downloading large files, it is important to download with resume.For that pass -c option to every time when resume the download. wget -c Download file in the background You can also download the file in the background using -b option, so you can use Terminal while downloading. wget -b You can check current download progress in wget-log file of current directory. nano wget-log Download file with limit speed Sometimes you also want to download file with limit speed. Pass --limit-rate option with maximum limit speed like this. In the bellow example, file will download with maximum speed of 100KB/S. wget --limit-rate=100k Download zip, tar file and extract to specified directory You can also download tar or zip file and extract to specified directory. Run the bellow command to download tar file with extracted to specified folder wget -q -O - | tar -xzf - --strip 1 -C ~/Downloads/file Download file with increase retry attempts You can add retry attempts --tries wget --tries=50 Download file over FTP The Wget command can also use with FTP. You’ll only need to specify the username and password as in this wget example: wget --ftp-user=USERNAME --ftp-password=PASSWORD Download whole website You can also download whole website in your local system. Use the bellow command to download the full website: wget --mirror --convert-links --page-requisites --no-parent -P Downloads/website/ In the above command, --mirror                download with recursive strategy --convert-links         All links converts to offline --page-requisites       download all files -P                      Download content to specified directory Download files over HTTPS site without checking SSL certificate If you want to download the file over HTTPS without checking SSL certificate, run the bellow command. This is useful in case invalid certificate. wget --no-check-certificate Set your user agent You can also set your User-Agent by self while downloading files. Pass -U option to add your User-Agent. It is useful in arbitrary string to be set for the user agent. wget -U YOUR-USER_AGENT View Response Header To view response header of the file, pass -S --spider option along with command. wget -S --spider Conclusion This way, you can use Wget command-line tool for download files from the internet. There are many other tricks you can use. To get more details about Wget visit the GNU wget Manual page. If you have any query, please do let us know in the bellow comment section.
What Is the Bashrc File Used For
If you are using Linux operating system or used before, then you have probably also used Terminal, a command line utility in Linux and Unix-like operating system. Linux Terminal comes with Bash which is one of the Linux shell script just like zsh, dash, csh etc. Bash is the most common and popular shell script preinstalled in Linux operating system. Whenever you input command in the Terminal, Bash runs .bashrc file and interprets and outputs according to command input. There are .bashrc file in each user's home directory. The .bashrc file is script that is executed whenever a new terminal session is started in interactive mode. The .bashrc file also contains configuration settings, set environment variables, for the particular user sessions. There is .bashrc file in /etc/skel/ location which is copied to user's home directory whenever new user is created. User's .bashrc file runs everytime whenever user opens bash. There is also .bashrc file in /root directory which runs on root user opens shell. How to edit .bashrc file? To edit .bashrc file, open Terminal and run the bellow command. nano ~/.bashrc This will open ~/.bashrc file in Nano editor. You can also use other editor also to change ~/.bashrc file by drag and drop to editor or with right click and open it. Whenever you make changes in your bashrc file, changes will be applied to the next Terminal launch. If you immediately want to apply the changes, run the bellow command after you make changes. source ~/.bashrc What to change in .bashrc There are some tricks you can change in bashrc file and can do more things in Terminal. Aliases Aliases allows you to input shorthand code of your long command. It is one type of variable that is assign to long command input. So whenever you input alias in the Terminal, it will execute its value command. This is the basic syntax to create alias. alias alias-name='command-to-execute' For example, lets check bashrc file and look for some aliases. # some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' So whenever you enters 'll' command, bash will execute command 'ls -alF'. By this way, you can also create your personal alias also. Suppose you need to open Google chrome directly from the Terminal, then you need to enter google-chrome command. You can set alias to open Google Chrome. alias google='google-chrome' You can also set alias to change current working directory with bellow command. alias html='cd /var/www/html' You can also set alias to generate notification. The bellow command will create notification of current date and time. alias time='notify-send --urgency=low "`date "+%Y-%m-%d %H:%M:%S"`"' Function You can also execute multiple command by creating function which executes multiple command. functionName () {     command1     command2 } Suppose you want to open Google Chrome and Nautilus file manager with single command, then you can create function for that. google () {     google-chrome     nautilus } Then just run bellow command in the Terminal. It will open Google Chrome and File manager. google Change font color for Terminal Default bash configuration stored in the PS1 variable. Just include the color code information to where you want to change color. Bellow are the list to which you can change color. \u: Current username \h: Hostname \W: Current working directory \$: # if user is root otherwise display a $ Here is list of color code. No color = '\e[0m' White = '\e[1;37m' Black = '\e[0;30m' Blue = '\e[0;34m' Light blue = '\e[1;34m' Green = '\e[0;32m' Light green = '\e[1;32m' Cyan = '\e[0;36m' Light cyan = '\e[1;36m' Red = '\e[0;31m' Light red = '\e[1;31m' Purple = '\e[0;35m' Light purple = '\e[1;35m' Brown = '\e[0;33m' Yellow = '\e[1;33m' Gray = '\e[0;30m' Light gray = '\e[0;37m' Bellow are some examples of how to change the default color: This will change Yellow color to username and hostname while red color to current directory. PS1='\e[01;33m\u@\h: \e[0;31m\W\e[0m\$' Or give more color to particulars. PS1="\[\e[32m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]:\[\e[36m\]\w\[\e[m\]\[\e[32m\]]\[\e[m\]\[\e[32;47m\]\\$\[\e[m\]" Note: run source ~/.bashrc command everytime to change effect immediately. Restore bashrc file If you have done something wrong and want to edit from start, you can always delete bashrc file and copy from the /etc/skel/ directory. cp /etc/skel/.bashrc ~/ Conclusion bashrc is useful to customize your Terminal command and gives you power to work more efficiently. Try out it and give your performance boost.
How to install Samba share and transfer files between Windows and Linux
Samba is powerful and open-source tool file server that allows file sharing across different operating systems over a network. You can access files your desktop to Windows and MacOS computers. This article covers how to set up a Samba file server and share files across a local network. Installing Samba To install Samba, first run the below command in Terminal: sudo apt-get update sudo apt-get install samba You can check if the installation was successful by running the following command: samba --version Setting up Samba Now we are going to setup Samba to share a folder. Here I will use ~/samba directory for sharing. The configuration file for Samba is located at /etc/samba/smb.conf. To add a new directory for sharing, edit the configuration file by running following command: sudo nano /etc/samba/smb.conf This will open the file in Nano editor. Now add the below lines at the end of file. [sambashare]     comment = Samba on Ubuntu     path = /home/username/samba     read only = no     browsable = yes Then save and exit the nano editor by pressing shortcut key CTRL+O and CTRL+X. Now restart the Samba service by the following command. sudo service smbd restart Update the firewall rule to allow Samba traffic. sudo ufw allow samba And setup the Samba password to user account. sudo smbpasswd -a username Connecting to Samba Now from the other, where you want to access the samba folder, open the file manager and Click on Connect to Server. In the server address enter the following lines with computers IP address. smb:// On Windows system, open File Manager and edit the file path. smb:// For MacOS system, in the Finder menu, click Go > Connect to Server then enter the below address: smb:// This way you can access the folder of the computer. If you want to see all files and folders shared by the computer, just input the IP address: smb:// This way you can access the files and folders shared by Samba.
10 basic commands that every regular Linux users need to know Part 2
In the previous article, we have discussed basic commands that almost every Linux user need in the regular work. These commands are common for all Linux distribution. In this article, we will discuss about more commands that are not essentially required but it is good practice to use it. These commands may be hard for new Linux user but it is essential for daily Linux user. Here are the few commands that are helpful for regular day to day work for Linux users. chmod The chmod command change the file or folder permission to read, write and execute. These permissiona are for owner user, group of users and for others. There are two ways you can assign or check permissions for file or folder. In a numeric way you can assign permission: r (read) = 4 w (write) = 2 x (execute) = 1 no permissions = 0 These permission number in 3 numeric digit. Suppose a file has permission of 755, then below are this permisssion. Owner has read, write and execute rwx = 4+2+1=7 Group has read and execute permission r-x = 4+0+1=5 Others has read and execute permission r-x = 4+0+1=5 To change the file or permission, run the commands: chmod 777 /path/to/dir To recursively set read, write, and execute permissions, use -R option. chmod -R 755 /path/to/file df You can easily check disk space with df command. For human readable format, use -h option. df -h free free command will return total physical memory and swap space. You can better manage about swap space. -h option will allow to view in human readable format. free -h grep grep command is used to search for string or search for pattern in the file. grep 'string' file.txt To search with case insensitive, use -i option. grep -i 'String' file.txt You can also search from multiple files. grep -i 'String' file.txt file2.txt file3.txt Also search pattern can be used. grep '^string' file.txt cat cat command let you to view file content. cat /path/to/file kill Sometimes you want to close the program, which you can not close from GUI. You can stop program by process id. kill process-id To forcefully close the program, use -9 option. kill -9 pid To view the process id of program, run ps command. ps aux To close all subprocess of the program. you can simply use killall command. killall pid shutdown shutdown command used to halt and shutdown the computer. You can simply set time to shutdown computer. shutdown 10:30 or after minutes. shutdown +30 To stop shutdown use -c option. shutdown -c Reboot the machine with -r option. shutdown -r uname uname comman will print the system option. print all information with -a option. uname -a Or with specific information with below options. print the kernel name uname -s print the network node hostname uname -n print the kernel release uname -r print the kernel version uname -v print the machine hardware name uname -m print the processor type (non-portable) uname -p print the operating system uname -o w w command  displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. whoami whoami command print the current logged user name.
9 basic commands that every new Linux users need to know
Whenever thinking about Linux, most of people thinks Linux is only for computer programmers as it only works with commands. However it is not true. There are many modern Linux distributions are available where you don't even need to open Terminal once. You can do any everyday task with graphical interface without using any commands. However with command line interface, you can just type commands to tell the computer what to do. That is faster and more powerful way to work with Linux systems. While working with Linux system, it is sometimes fun to use command line interface. Whether you are new Linux users or normal Linux users, you have to know these basic commands to use maximux use of your system. This article will lead to you know about 10 basic command that will help you to better understand your system and applications. These Linux commands are common and applies all distributions of Linux. ls ls is the first command that everyone starting to use. ls command simply prints list files and folders in the the current directory. If you want to see files and folders in the another folder, then type ls and then type directory path. For example, below command will output files and folders in Downloads folder. ls ~/Downloads ls command used with different arguments, here are some list. If you want see files and folder in list with permission details, then use -l argument. ls -l -a option will also include hiddent files and folders also. ls -la pwd pwd command simply prints current working directory with path from root. For example, If you are in Downloads folder, then pwd will prints /home/user/Downloads path. cd cd command simply used to change your current directory. You can either move with absolute path from the root or relative path from the current folder. For example cd .. will move to one folder up from the current folder. Use cd command without path to move home folder. Press TAB button to autocomplete the folder name. mv mv command used to move the file to another location or rename. For exmple, if you want to move and raname ~/Downloads/photo.jpg to ~/Pictures folder, then use below command. This command will move and rename also. mv ~/Downloads/photo.jpg ~/Pictures/new-photo.jpg cp cp command is used to copy the file from one folder to anaother folder. For example, below command will copy photo.jpg file from current directory to ~/Pictures folder. cp  photo.jpg ~/Pictures rm Use rm command to remove file or folder. There are argument need to remove files and folder in specific case. For example, use -f command to remove files forcefully. rm -f Photo.jpg -r will also allow to remove directory with its content. rm -rf ~/Downlads/files mkdir mkdir command will create directory in the current directory. Pass directory path to create directory at different location. Use bellow command to create directory at ~/Pictures location. mkdir ~/Pictures/new touch touch command will simply create blank file. For example, below command will create index.html file in /var/www/html folder. touch /var/www/html/index.html man man command is manual for other command. It will give all the details and arguments for command. Run man touch command to see what touch command will do and which arguments are available to use. Press q button after you have finished reading the manual. sudo sudo command is needed whenever root user permission required. sudo command is prefixed with other command that requires root permission. Installing software or working with system directory, you need to grant sudo permission. Use this command carefully as it will also modify in the system. For example, below command will change password for current user. sudo passwd username If you want to change to root user in command line, then use below command. It will change to root user mode. sudo su Finally you are ready to use Terminal. In this article, you have learned basic commands that need for day to day use. In the next article, we will go deep and discuss about more commands.