Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Open Source Articles
Page 67 of 123
Free Command in Linux
The free command is one of the most essential Linux system administration tools used to display memory usage information. It provides real-time statistics about physical RAM, swap space, buffers, and cache usage, making it invaluable for system monitoring and troubleshooting memory-related issues. What is the Free Command? The free command displays the total amount of free and used physical memory and swap space in the system, as well as the buffers and cache used by the kernel. It reads information from /proc/meminfo and presents it in a human-readable tabular format. Syntax free [options] ...
Read MoreGuide to Linux screen Command
When working on a Linux terminal, you may sometimes need to keep several processes running at the same time. However, if you close the terminal or accidentally disconnect from a remote session, processes will terminate, and you may lose all your progress. This is where the Linux screen command comes in handy. Screen is a powerful command-line utility that allows you to create and manage multiple terminal sessions within a single shell window or over SSH connections. It is a handy tool for managing long-running processes or multiple commands, even if you are not physically connected to the server. ...
Read MoreUsing xz Compression in Linux
xz compression is a high-ratio data compression tool widely used in Linux environments to reduce file sizes, improve transfer speeds, and save storage space. Developed by Lasse Collin and based on the LZMA (Lempel-Ziv-Markov chain-Algorithm) compression algorithm, xz offers superior compression ratios compared to traditional tools like gzip and bzip2. How xz Compression Works The xz algorithm breaks input data into small blocks and compresses each block independently using the LZMA algorithm. The compressed blocks are then combined and stored in an output file with the .xz extension. LZMA uses a combination of dictionary-based and statistical compression techniques ...
Read MoreFind the Process That is Using a File in Linux
When working with files in Linux, you may encounter situations where you cannot unmount a filesystem or access a file because it shows as "busy". This occurs when a process is actively using the file, keeping it open for reading or writing. To resolve this, you need to identify which process is using the file. This tutorial covers the essential commands to find processes that are using specific files in Linux systems. Note − Linux commands are case-sensitive. Commands to Find the Process Linux provides several commands to identify processes working with files. These commands gather ...
Read MoreFixing the "Too many open files" Error in Linux
On Linux servers under heavy load, the "too many open files" error occurs frequently. This error indicates that a process cannot open new files (file descriptors) because it has reached the system-imposed limit. Linux sets a default maximum open file limit for each process and user, and these default settings are often modest for production workloads. The number of concurrent file descriptors that users and processes can open is constrained by system limits. When a user or process attempts to open more file descriptors than allowed, the "Too many open files" error appears. The solution involves increasing the maximum ...
Read MoreHow to Set Wget Connection Timeout in Linux?
Wget is a free GNU command-line utility for downloading files from web servers using HTTP, HTTPS, and FTP protocols. When downloading files over unreliable network connections, you may encounter timeouts that cause downloads to fail. Linux provides several wget timeout options to handle these situations effectively. Installing Wget in Linux Most modern Linux distributions come with wget pre-installed. To check if wget is available, open your terminal and type wget. If installed, you'll see "wget: missing URL". If not installed, you'll see "command not found". Ubuntu and Debian sudo apt install wget CentOS ...
Read MoreHow to Show the wget Progress Bar Only in Linux?
Remote management of UNIX/Linux/BSD servers via SSH session is a common practice. For installation, you might need to download software or other files. While Linux has several graphical download managers, the wget command-line tool is preferred for non-interactive downloads. The wget command supports various Internet protocols including HTTP, HTTPS, and FTP. Basic Wget Usage The simplest use of wget is downloading a single file to your current directory. Type wget followed by the file URL − $ wget https://www.tutorialspoint.com/index.htm --2022-12-26 10:18:13-- https://www.tutorialspoint.com/index.htm Resolving www.tutorialspoint.com (www.tutorialspoint.com)... 192.229.221.69 Connecting to www.tutorialspoint.com (www.tutorialspoint.com)|192.229.221.69|:443... connected. HTTP ...
Read MoreParse Command Line Arguments in Bash on Linux
Command-line arguments are parameters passed to bash scripts that allow users to customize script behavior without modifying the script itself. These arguments can be processed sequentially as positional parameters or parsed as options using built-in utilities like getopts and external tools like getopt. Note − Linux commands are case-sensitive. Basic Command Line Arguments Bash automatically stores command-line arguments in special variables: $0 − Script name $1, $2, $3... − Positional arguments $# − Number of arguments $@ − All arguments as separate strings $* − All arguments as a single string #!/bin/bash ...
Read MoreSkip Hidden Files and Directories During Recursive Copy
Recursive copying is a common task in Linux systems, but sometimes we need to exclude hidden files and directories (dotfiles) during the process. Hidden files in Linux are those that start with a dot (.) and are typically used for configuration files and system data that should remain invisible during normal operations. This tutorial demonstrates various methods to skip hidden files and directories when performing recursive copy operations using different Linux utilities. Note − Linux commands are case-sensitive. Using cp Command with Shell Globbing The standard cp command can be combined with shell globbing patterns to ...
Read MoreTesting Bash Scripts With Bats in Linux
Bash Automated Testing System (BATS) is a testing framework designed specifically for bash scripts. It allows developers to write automated tests for their bash code, ensuring scripts function correctly before deployment and improving code reliability in production environments. BATS provides a structured approach to testing bash scripts similar to testing frameworks available for other programming languages like Python or Java. It uses a simple syntax that makes writing and maintaining tests straightforward for shell script developers. What is BATS? BATS stands for Bash Automated Testing System. It is a TAP-compliant testing framework that runs tests written in ...
Read More