Earlier, I’d written about how the awk statement in Linux can be a superior alternative to grep in many situations. One of those included the ability to perform complex operations, including control loops. The “if-else” statement is one of the most basic control loops in all languages. While it’s strange to view awk as a […]
How to Remove a Remote Origin in Git
Most people working on a git repository, have done so by cloning a remote one. The thousands of developers who work on projects everyday, have mostly taken an existing repo and are working on it. When you do this, git sets up a connection to the remote repo and calls it the “origin”. This makes […]
What Is SIGSEGV and How Do We Fix It?
SIGSEGV is a signal sent by the operating system to a process indicating that the process has attempted to access memory that it shouldn’t. This kind of error is prevalent in low-level code – that deals directly with system code, for example. These days, SIGSEGV errors are rare because of improvements in modern programming languages […]
How to Reset the Last Commit in Git
While the purpose of git is to maintain a faithful record of a project’s history, it’s usually not a good idea to blindly include every single change, including mistakes or tiny commits that should be merged into a single one. I’ve written before, about how we can use git squash to keep a clean project, […]
How to Redirect stderr to stdout in Linux
Linux uses the concept of “streams” to handle input and output messages. Specifically, there are three: These streams are defined by the environment in which a command operations, and doesn’t depend on the command itself. So if a script has an output – say via an “echo” statement or it throws an error, these messages […]
How To Create Groups In Linux
A group in Linux is a way to bunch users together so that they’re easier to manage in one place. The easiest way to demonstrate the power of groups is to show how we can manage their permissions in one go. But you can do more than just manage permissions. With special “control groups”, you […]
How To Use The Bash Heredoc Syntax In Linux
Linux allows you to use the bash prompt to provide the input for a variety of commands. For example, let’s say you want to quickly create a file with some text. The following will work nicely: echo “Test file” > testfile.txt This will create a file called “testfile.txt” as shown here: You can see that […]
How to Use the “Find” Command on Linux
The “find” command in Linux is more than what meets the eye. On the surface, it’s a simple way to search for files and folders. But once you understand its power, you’ll see that it can be used for more than that. First I’ll show you how to use its basic functionality, and then we’ll […]
What Is /dev/shm And Why Is It So Useful?
In Linux, /dev/shm is a special location that you can use to store files and folders. This location is available to all applications that use the system and is incredibly fast because the data isn’t stored on the disk, but in RAM. In addition, the data is only temporarily stored and is lost after a […]
Fixing “the following packages have been kept back” Ubuntu Error
On Debian systems like Ubuntu, we keep all our packages up to date by using the following commands: sudo apt updatesudo apt upgrade The first statement gets the list of all updated packages from the repositories and also compares what you have to what’s available, thereby creating a checklist for things to update and giving […]
