Tag: Linux
Browse all articles, tutorials, and guides about Linux
Posts
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 Reset Local Git Branch to Match Remote Repository HEAD
Learn different methods to reset your local Git branch to exactly match the remote repository HEAD, including hard reset, fetch and reset, and when to use each approach safely.
How to Reset or Revert a File to a Specific Revision in Git
Learn multiple ways to reset or revert a specific file to a previous version in Git, including using git checkout, git restore, and git show commands with practical examples.
How to Push a New Local Branch to Remote Git Repository and Track It
Learn how to push a new local Git branch to a remote repository and set up tracking, including different methods for initial push, setting upstream branches, and managing branch relationships.
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 Revert Git Repository to a Previous Commit Safely
Learn multiple safe methods to revert your Git repository to a previous commit, including using git revert, git reset, and git checkout with practical examples and safety considerations.
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 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 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 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 Fix Docker: Permission Denied
Getting a 'permission denied' error when using Docker can be frustrating. Here's how to fix it depending on the OS, Docker command, and user setup.
How to Check if a String Contains a Substring in Bash
Learn multiple methods to check for substring presence in Bash, including pattern matching, case-insensitive searches, and practical examples for string validation.
How to Concatenate String Variables in Bash
Learn multiple ways to combine string variables in Bash scripts, from simple concatenation to complex string operations with practical examples.
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 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 File Does Not Exist in Bash
Learn various methods to test for file non-existence in Bash scripts, including proper error handling, permission checks, and practical automation examples.
How to Extract Filename and Extension in Bash
Learn multiple methods to extract filenames, extensions, and directory paths from file paths in Bash using parameter expansion and basename commands.
How to Split a String on a Delimiter in Bash
Learn multiple methods to split strings using delimiters in Bash, including IFS, parameter expansion, and array techniques with practical examples.
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.
How to Redirect and Append Both stdout and stderr to a File in Bash
Learn different methods to capture both standard output and error streams in Bash, including appending to files and separating streams for better logging.
How to Check if a Program Exists from a Bash Script
Learn multiple reliable methods to check if a command or program is available on your system from within Bash scripts, including using which, command, and type.
What Does "2>&1" Mean in Linux and Bash?
Learn what the 2>&1 redirection operator means in Linux commands, how it works with standard output and error streams, and when to use it effectively.
How to Count Lines of Code in a Directory Recursively
Discover multiple methods to count source code lines across entire directory trees, including filtering by file types and excluding specific directories.
Cannot Connect to the Docker Daemon at unix:/var/run/docker.sock. Is the Docker Daemon Running?
Troubleshoot the common Docker error about not being able to connect to the Docker daemon. Learn why it happens and how to fix it on Linux and macOS.
How to Get the Directory Where a Bash Script is Located
Learn multiple reliable methods to determine the directory path of your Bash script from within the script itself, including handling symbolic links and edge cases.
How to Reload .bashrc Settings Without Logging Out
Need to apply changes to your .bashrc file immediately? Learn multiple methods to reload your Bash configuration without restarting your terminal session.
Looping Through File Content Line by Line in Bash
Learn multiple techniques to read and process file content line by line in Bash scripts, including handling special characters and preserving whitespace.