Linux
Browse all articles, tutorials, and guides about Linux
About Linux
Dig into the Linux ecosystem, from command-line basics to system administration. Learn to manage servers, troubleshoot issues, and optimize performance.
Posts
What do PTY and TTY Mean?
TTY and PTY are interfaces for text input and output in Unix systems. Learn the difference between physical terminals (TTY), pseudo-terminals (PTY), and how they enable SSH sessions, terminal emulators, and command-line tools.
Network Usage Top/Htop on Linux
Monitor real-time network bandwidth usage on Linux with tools like iftop, nethogs, nload, and bmon. Learn which processes are consuming bandwidth, track interface statistics, and identify network bottlenecks.
How to Kill All Processes with a Given Partial Name in Linux
Learn how to terminate multiple processes by matching partial names using pkill, killall, and other methods. Understand the risks and safe practices for bulk process termination.
How to Measure the Actual Memory Usage of an Application or Process
Learn how to accurately measure real memory usage of processes in Linux, understand the difference between virtual, resident, and shared memory, and use the right tools for memory analysis.
How to Get Current Date and Time in Linux Terminal and Create Custom Commands
Learn how to display the current date and time in various formats using the date command, and create custom shell aliases for quick access to your preferred formats.
Increasing the Maximum Number of TCP/IP Connections in Linux
Learn how to tune Linux kernel parameters to handle more TCP connections for high-traffic servers. Adjust file descriptors, TCP backlog, port ranges, and connection tracking limits to scale your applications.
How to Tar a Directory While Excluding Files and Folders
Create tar archives without including unnecessary files like node_modules, .git, or build artifacts. Learn to use --exclude patterns effectively for cleaner backups.
How to Force cp to Overwrite Files Without Confirmation
Learn how to use cp command to overwrite existing files without prompts, understand the -f flag, and handle alias conflicts that cause unexpected confirmation requests.
How to Remove a Symlink to a Directory in Linux
Removing a symlink to a directory can be tricky if you're not careful. Learn the correct way to delete symlinks without accidentally removing the target directory's contents.
How to Get the Full Path of a File in Linux
Learn different methods to get the absolute path of a file in Linux, from simple commands like realpath to handling relative paths and symlinks correctly.
How to Exclude Directories from grep -R
Learn how to exclude specific directories when searching recursively with grep, including node_modules, .git, and other directories you want to skip.
How to Create Symbolic Links in Linux
Learn how to create and manage symbolic links (symlinks) in Linux to create shortcuts, organize files, and maintain flexible file system structures.
How to Kill a Process Running on a Particular Port in Linux
Learn multiple methods to identify and terminate processes that are using specific ports on Linux systems using netstat, lsof, fuser, and ss commands.
How to Prompt for Yes/No/Cancel Input in Linux Shell Scripts
Learn how to create interactive shell scripts that prompt users for confirmation with Yes/No/Cancel options using various techniques and best practices.
How to Check Which Process is Using a Specific Port from Command Line
Learn how to identify which processes are listening on specific ports using netstat, lsof, and ss commands across different operating systems.
How to Find Files Containing Specific Text on Linux
Need to locate files with specific content? Learn how to use grep, find, and other Linux tools to search through files and directories efficiently.
How to Create a Copy of a Directory in Unix/Linux
Learn various methods to copy directories in Linux and Unix systems using cp, rsync, and tar commands with practical examples and best practices.
How to Loop Through File Content in Bash
Learn different methods to iterate through file content line by line in Bash scripts, including handling special characters and processing large files efficiently.
How to Change File and Folder Permissions Recursively in Linux
Learn how to use chmod command to change permissions for directories and all their subdirectories and files efficiently and safely.
How to Change Echo Text Colors in Linux Terminal
Learn how to colorize your terminal output using ANSI escape codes with the echo command to make scripts more readable and visually appealing.
How to Count Number of Lines in Files Using Linux Terminal
Learn different methods to count lines in text files like CSV, TXT, and other non-binary files using wc, awk, sed, and other Linux command-line tools.
How to Close Specific Ports on Linux Systems
Learn how to close and block specific ports on Linux using iptables, ufw, firewalld, and by stopping services. Secure your system by controlling port access.
How to Use Grep to Show Only Filenames on Linux
Learn how to use grep options to display only the names of files containing matches, making it easier to identify relevant files in large searches.
How to Recursively Count Files in a Linux Directory
Learn different methods to count files in a directory and its subdirectories, including fast one-liners and options for filtering by type, size, or pattern.
How to Exclude Directories When Using Find in Linux
Learn how to exclude specific directories from find command searches to improve performance and focus on relevant results when searching through file systems.
How to Loop Through an Array of Strings in Bash
Learn various methods to iterate through string arrays in Bash, including indexed arrays, associative arrays, and advanced looping techniques with practical examples.
How to Pipe to and from Clipboard in Bash Scripts
Learn how to integrate clipboard functionality into your Bash scripts using xclip, xsel, pbcopy, and pbpaste for seamless data transfer between terminal and GUI applications.
How to Recursively Grep All Directories and Subdirectories
Learn how to use grep with recursive options to search through entire directory trees efficiently, including advanced filtering and performance optimization techniques.
Defining Variables with and without Export in Linux Shell
Understand the difference between regular shell variables and exported environment variables, when to use export, and how variable scope affects scripts and processes.
How to Find Files Using Wildcards in Linux
Learn how to use wildcard patterns with find command to recursively search for files in directories and subdirectories based on name patterns.
How to Profile C++ Code Performance on Linux
Learn how to use profiling tools like gprof, Valgrind, and perf to analyze C++ application performance and identify bottlenecks on Linux systems.
How to Use sudo to Redirect Output to a Privileged Location
When you try to redirect output to a file you don't have permission to write, sudo doesn't help the way you'd expect. Learn the right techniques to write to protected files.
How to Delete Exported Environment Variables in Linux
Learn different methods to remove environment variables from your current shell session and prevent them from persisting in future sessions.
How to Compare Two Directory Trees and Find Files That Differ by Content
Learn different methods to compare two directory structures and identify which files have different content, using tools like diff, rsync, and custom scripts.
How to Fix "Argument List Too Long" Error for rm, cp, and mv Commands
Solve the 'argument list too long' error when working with thousands of files. Learn to use find, xargs, and loops as alternatives to wildcards for bulk file operations.
How to Permanently Set $PATH on Linux and Unix
Learn how to permanently modify your PATH environment variable on Linux and Unix systems so your custom directories persist across shell sessions and reboots.
How to Grep a Continuous Stream in Real-Time
Learn how to filter live log streams with grep, including line-buffering for immediate output, following log files, and monitoring command output as it happens.
How to Copy Command Output Directly to Your Clipboard in Linux
Learn how to pipe command output to your clipboard using xclip, xsel, or pbcopy. Make terminal output available for pasting into applications without selecting and copying manually.
How to Fix Echo Newline in Bash When It Prints Literal \n
Learn why echo sometimes prints literal \n instead of newlines and discover multiple solutions to properly output newline characters in Bash scripts.
How to Parse Command Line Arguments in Bash
Learn various methods to parse command line arguments in Bash scripts, including positional parameters, getopts, and advanced argument handling techniques.
How to Change the Output Color of Echo in Linux
Learn how to add colors to your echo output in Linux and Bash scripts using ANSI escape codes, tput commands, and color variables for better terminal display.
Redirecting Output to Both a File and stdout in Bash
Learn how to capture command output in a file while still seeing it live in your terminal
How to Check if a Directory Exists in Bash Shell Scripts
Learn multiple methods to check directory existence in Bash scripts, including proper error handling, permission checks, and practical use cases for reliable automation.