How the touch Command Works on Linux

The touch command lets us create files or update the access or modified date of a file. It was first created in 1979 by AT&T Bell Laboratories. Today, touch can be accessed via the terminal on Linux and Unix-based systems.

In this guide, let's look at how touch works. The syntax for touch can be seen below, where x is the name of the file we want to interact with or create, and [OPTIONS] are optional settings we can include:

How the cp Command Works on Linux

The cp command (not to be confused with cd), allows us to copy files or directories. As such it is very commonly used on Linux and Unix-like systems like MacOS.

The syntax for cp is shown below, where [OPTIONS] are optional settings we can change, SOURCE is one or more files/directories we want to copy, and LOCATION is where we want to copy them to:

How the Chown Command Works on Linux

In previous articles, we've covered how chmod works. In this article, we'll be covering how to use chown. chown is closely connected to chmod since it affects who owns a file, and which group it belongs to.

In our article on chmod we cover how different user types (i.e. owners, groups, and all other users) have different permission sets. That means who owns or in which group a file belongs, can affect who can run it, and might even affect if a system process can run or open a file.

How the Find Command Works on Linux

The find command on Linux and Unix-like systems (i.e. macOS) is used to find files and directories in a specific directory. It is one of the most useful commands at your disposal when trying to find and process multiple files. It's also really useful during file audits.

The syntax for find is shown below, where [OPTIONS] are optional settings, [LOCATION] is the location you want to find something within, and [SEARCH TERM] is the file name or directory name you want to find.

How the which Command Works on Linux

When we are running servers, or even our local computer, different applications may install the same piece of software multiple times. For example, it is not uncommon to accidentally have two versions of Node.JS installed on a server or computer.

In the example where we have multiple versions of Node.JS, it can be confusing which versions are running, or which will be used when we run the node command in a terminal window.

Create Desktop Notifications and Reminders From Linux Terminal

Introduction

Sometimes it’s useful to get visual feedback from a script. For example when the script or cron job completes. Or when the long-running build fails. Or when there is an urgent problem during script execution. Desktop applications can do this with popup notifications. But it can be done from the script too! You can use script commands to send yourself desktop notifications and reminders. Check this out:

The below code has been written and tested on Linux. What about MacOS? Well… it can be done too, with a bit of effort. See the last chapter for some hints and tips.

Git Bash (Or Git in Bash)?

Do you know when you install Git Bash on windows what exactly you are installing? Most of the time, developers think they are only installing Git. But that's not true.

Let me repeat it: actually, you are installing Git Bash.

Inserting Dynamic Data Into Jekyll Static Sites Using Python or Bash

Jekyll, the static site generator, uses the _config.yml for configuration. The configurations are all Jekyll-specific. But we can also define variables with our own content in these files and use them throughout our website. In this article, I’ll highlight some advantages of dynamically creating Jekyll config files.

On my local laptop, I use the following command to serve my Jekyll website for testing:

Learn Powershell With These 5 Steps

I work with a lot of different technologies every day, some are fun to use while others are a little boring and repetitive. To help with the repetitive part, I turned to scripting. (Blogging has been pretty fun too!)

Recently I started thinking about how much I have learned about scripting over the past few years, and then I thought about sharing this information with my readers. So I came up with this article in the form of a question: How do I learn Powershell for Beginners? 

Small Peek Into Bash

What is bash? Bash is that black screen that normally appears in Linux as the terminal. Bash is a Unix shell written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. It was released in 1989 and has been distributed as the Linux and macOS default shell for a long time.

Shells and Modes

The user bash shell can work in interactive and non-interactive login shells.

  • Interactive login shell: You log into a remote computer, for example via ssh. Alternatively, you drop to a tty on your local machine (Ctrl+Alt+F1) and log in there.
  • Interactive non-login shell: Open a new terminal.
  • Non-interactive non-login shell: Run a script. All scripts run in their own sub shell and this shell is not interactive. 
  • Non-interactive login shell: This is extremely rare, and you're unlikely to encounter it. One way of launching one is echo command | ssh server. When ssh is launched without a command (so ssh instead of ssh command which will run command on the remote shell) it starts a login shell. If the stdin of the ssh is not a tty, it starts a non-interactive shell. This is why echo command | ssh server will launch a non-interactive login shell. You can also start one with bash -l -c command.

Comments

Scripts may contain comments. Comments are special statements ignored by the shell interpreter. They begin with a # symbol and continue on to the end of the line.

7 Coding Tools That Will Maximize Your Effectiveness

When learning to code, developers-to-be are usually taught to code vanilla software. In the workplace, however, developers use many tools to speed up their coding. Common tasks like testing, running various scripts, and programming environment control are just a few examples of when an extra tool comes in handy.

The trouble is, there are many of these tools on the market, and it’s hard to know which are best. It often takes years of trial and error to discover which tools are the most helpful. To save you that effort, we asked some experienced developers about the tools that have helped them become better coders and maximize their efficiency on the job.

Getting Started With Ubuntu and Bash Shell

Introduction

Ubuntu is a free, open-source operating system that you can install on your laptop or desktop. It comes in desktop and server versions. Ubuntu is easy to install, simple to use, safe, secure, fast, and massively powerful.

Ubuntu is a distribution of Linux. The Linux kernel is at the core of the operating system and it does all the essential low-level stuff.

Splitting Lines and Numbering the Pieces

As I mentioned in my computational survivalist post, I’m working on a project where I have a dedicated computer with little more than basic Unix tools, ported to Windows. It’s given me a new appreciation for how the standard Unix tools fit together; I’ve had to rely on them for tasks I’d usually do a different way.

I’d seen the nl command before for numbering lines, but I thought, “Why would you ever want to do that? If you want to see line numbers, use your editor.” That way of thinking looks at the tools one at a time, asking what each can do, rather than thinking about how they might work together.

Customize Shell on Mac OSX

Get the shell layout you deserve

If you're an active Mac user that spends a good amount of time using shell, you may have noticed that the OSX Shell by default is bear bone and not very productive to use on a daily bases.

The question is, how we can make OSX shell more productive?

Sampler: Dashboards, Monitoring, Alerting From Your Terminal

As a backend developer, I always need to monitor something — the state machine in the database, records count, message queue lag, custom application metrics, system performance, progress of my deployment scripts.

For a long time, I was trying to find a tool that could do keep everything in one place, alert me on a trigger, and be as fast and nimble as a local development tool. Heavy production monitoring systems can't help with such tasks; I needed a swiss army knife — something that could be configured in a minute and give me results right away.