Posts

How to check RAM in Linux

Image
  There are several commands that you can use to check the RAM memory in Linux, such as   free ,   vmstat ,   /proc/meminfo , and   dmidecode . Here are some examples of how to use them: To check the total, used, free, and available memory in human-readable format, you can use the   free -h   command. This will also show the swap memory, which is a virtual memory that can be used when the physical memory is full. The command output is shown below: To check the memory statistics, such as the number of pages swapped in and out, the amount of memory that is active or inactive, and the system’s memory usage, you can use the   vmstat   command. This will display the information in kilobytes by default, but you can use the   -S   option to change the unit. To check the detailed information about the memory, such as the total, free, available, cached, and buffered memory, as well as the low and high memory zones, you can use the   cat...

Grep Command in Linux

The   grep   command in Linux is used to search for a specific pattern or string in a file or multiple files. The command can be used to search for a specific word, a phrase, or a regular expression. To search for a specific word, you can use the   -w   option with the   grep   command. For example, to search for the word “word” in a file named   file.txt , you can use the following command: grep -w "word" file.txt To search for a phrase, you can enclose the phrase in quotes. For example, to search for the phrase “500 word” in a file named   file.txt , you can use the following command: grep "500 word" file.txt To search for a regular expression, you can use the   -E   option with the   grep   command. For example, to search for all the lines that start with the word “word” in a file named   file.txt , you can use the following command: grep -E "^word" file.txt In the above command, the   ^   symbol is used to ma...

Vim : Powerful Text Editor

Certainly! Vim is a powerful and widely-used text editor that is popular among Linux users. Vim is an advanced and highly configurable text editor built to enable efficient text editing. Vim text editor is developed by Bram Moolenaar. It supports most file types and vim editor is also known as a programmer’s editor. We can use its plugin based on our needs. To install vim on Debian based Linux like ubuntu run the command:   sudo apt-get install vim . To install vim on an arch-based distro run the following command:   sudo pacman -S vim . Now vim will be installed on your system. You can open vim by running   vim   command on the terminal. Vim provides many features that make it a powerful text editor. One of the most important features of Vim is its modal editing system. Vim has two modes:   insert mode   and   command mode . In insert mode, you can type text into the document just like any other text editor. In command mode, you can use various comman...

Moving, Copying, and Removing Files in Linux

  In Linux, you can use the   cp   command to copy files and directories, the   mv   command to move files and directories, and the   rm   command to remove files and directories . Here are some examples of how to use these commands: To copy a file, use the following command:   cp source_file destination_directory/ . To copy a directory, use the following command:   cp -r source_directory destination_directory/ . To move a file, use the following command:   mv source_file destination_directory/ . To move a directory, use the following command:   mv source_directory destination_directory/ . To remove a file, use the following command:   rm file . To remove a directory, use the following command:   rm -r directory . Please note that the   rm   command is a powerful command and can delete files and directories permanently. So, be careful while using it.   You can use the   ls   command to list ...