Practical solutions

Linux Howtos How-To Guides

Solve the problem. Keep building. Collection of Linux how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Pass Parameter in a Bash FunctionThis tutorial demonstrates how to pass parameters in a Bash function. Learn the essential techniques for defining functions, handling multiple parameters, and setting default values. Enhance your Bash scripting skills and create dynamic scripts with ease. Explore practical examples and improve your coding efficiency today! How to Get Absolute Path in BashThis article demonstrates how to get an absolute path in Linux. How to Perform Copy, Cut and Paste Operations in Vim and ViLearn how Normal-mode yank, delete, and put commands select and place text in Vim and Vi. How to Run Bash Script in TerminalLearn how to run a Bash script in a Linux terminal with bash or by making it executable, and troubleshoot path and permission problems. How to Replace Strings in BashThis tutorial demonstrates how to replace one substring with another string in Bash. Learn effective methods using `sed`, `awk`, and Bash parameter expansion to enhance your string manipulation skills. Whether you're editing files or writing scripts, mastering these techniques will save you time and improve efficiency. Dive into practical examples and become proficient in Bash string replacements today! How to Check Kernel Version in LinuxThis article provides a comprehensive guide on how to check the running kernel version in Linux. Learn various methods, including using commands like uname, dmesg, and hostnamectl, to easily access kernel information. Ideal for system administrators, developers, and Linux enthusiasts, this guide ensures you have the knowledge to manage your system effectively. Bash Associative ArrayThis tutorial demonstrates how to create an associative array in Bash. How to Extract Substring in BashThis tutorial demonstrates different ways to extract a substring in bash using the cut command, substring expansion and Internal Field Separator. How to Read CPU Flags From CpuinfoLearn how to read Linux CPU information and interpret the flags reported by the running system. How to Sum a List of Numbers in a Text File Using BashThis article is a short tutorial on how to sum a list of numbers in a text file using Bash scripting. Learn effective methods such as using awk, paste with bc, and loops to efficiently calculate sums. Perfect for beginners and experienced users alike, this guide provides clear examples and explanations to enhance your Bash scripting skills. How to Run find -exec Command in BashThis article explores how to effectively use the find command with the -exec option in Bash. Learn to search for specific text in files and execute commands on found files. Discover practical examples, including searching for text, deleting old logs, and moving large files. Enhance your command-line skills with these powerful techniques. The Purpose of Sticky Bit in LinuxThis tutorial demonstrates the purpose of the sticky bit in Linux, explaining its importance in file management and security in shared environments. Learn how to set and remove the sticky bit using simple commands to enhance your Linux experience. How to Solve Syntax Error Near Unexpected Token Newline in Linux BashDiagnose Bash's syntax error near unexpected token newline by inspecting the reported line, redirections, quotes, grouping, and line continuations, then verify the fix. How to Check if a Variable Has a Value in BashThis tutorial will discuss checking if a variable contains a value in Bash. How to Perform Increment and Decrement Operation in BashLearn how to perform increment and decrement operations in Bash with our comprehensive guide. Discover various methods including arithmetic and unary operators, complete with clear examples. Enhance your Bash scripting skills and streamline your code with these essential techniques. How to Cat EOF in BashLearn how to use cat EOF in Bash effectively. This comprehensive guide covers the basics of cat EOF, including file creation, appending text, and writing scripts directly from the command line. Discover practical examples and enhance your Bash scripting skills today. How to Move Multiple Files in Linux BashLearn how to move multiple files in Linux Bash with `mv`, using explicit filenames and wildcard patterns to select files by name or extension. How to Declare and Utilize Booleans in BashLearn how Bash represents Boolean-like state, how command exit statuses work, and how to use safe conditions, integer flags, logical operators, functions, and loops. How to Solve Export Not a Valid Identifier Error in BashLearn why Bash reports that an exported name is not a valid identifier, how to fix spaces around assignments and invalid names, and how to check a scalar in a child command. Multi-Dimensional Array in BashLearn two ways to represent a two-dimensional table in Bash: a flat indexed array and an associative array. How to Generate Random Number in BashLearn practical ways to generate random values in Bash with $RANDOM, shuf, /dev/urandom, awk, and a reusable bounded-integer function. How to Assign Default Value in BashLearn how Bash parameter expansion supplies or assigns fallback values, how unset and empty variables differ, and when an if statement is a better fit. Difference Between Sh and BashLearn what a Linux shell does, how to identify the running and configured shells, and when to use sh or Bash. Difference Between a Login Shell and a Non-Login ShellThis tutorial explains the difference between a login shell and a non-login shell in UNIX-based systems.