Home » Linux » Shell

Systemctl: How to List Services (Status, Control, and Tips)

Systemctl: Status, Control, and Tips

In this guide, we explain how to use systemctl to list services and check on their status. We will also cover some of the other uses for systemctl. Coming from run_init service, systemctl is a breath of fresh air. I’m sure there are many reasons I’m wrong and I’ve heard the debates for and against it and changed my mind a few times. After using it daily at work, I’m in the systemctl camp now. The language of the command feels more natural now. On … Read more

Home » Linux » Shell

How to Kill a Process in Linux

Killing Processes

There are numerous methods that can be utilized to kill a process in Linux. This tutorial will teach you how to find and kill broken processes. A process can become orphaned easily. Whether on purpose or not, a parent process can crash and leave a child process running. Sometimes, a parent process fails to reap a completed child process, and it becomes a zombie. Both of these processes are stuck and need manual intervention. Enter job control. Let’s take a look at how to kill … Read more

Home » Linux » Shell

How to Rename a Directory in Linux

Rename Directories

In this tutorial, we explain how to rename a directory in Linux, using the “mv” and “rename” commands. Renaming directories is not very different from renaming files. Because after all, this is Linux, where everything is a file. Even the directories. So, most of what we discussed with renaming files works here too. Renaming directories with mv mv RenameDir/ renameDir There it is. Just mv it, like the song. Only special concerns, if you have anything directed to the directory. Make sure to search your … Read more

Home » Linux » Shell

Renaming Files in Linux – 2 Simple Methods

Renaming Files

In this article, we explain how to rename a file, or multiple files in Linux, using two different methods. Let’s dig into renaming files, the use of mv and rename, and why we use specific tools. Renaming files with mv – No longer the recommended method You have a web directory that somehow, the extensions became corrupt. We’re going to use the blog’s files for our example. ping www.linuxscrew.com #Test connectivity first. wget -m www.linuxscrew.com #Mirror on We are now the proud owner of a … Read more

Home » Linux » Shell

The Linux ‘cp’ Command: Copy files and Directories

'cp' Command

This tutorial will teach you to use the Linux cp command – the command that copies files from one directory to another. Linux is the preferred platform for a lot of developers. If you’re new to Linux it won’t be long before you need to start copying files from one place to another – read on for an explanation of the Linux cp command and some tips and tricks on how to use it. The cp Command The cp command has a simple purpose – to copy files and folders … Read more

Home » Linux » Shell

How to Add a User to a Group in Linux (With Examples)

Add a User to a Group in Linux

In this tutorial, we’ll examine adding users to groups. Bash shell commands are powerful tools for achieving specific needs. Groups are an effective way to share and protect information. File permissions in Linux allow you to set ownership by user rights, group rights, and global. It’s also a perfect way to maintain user permission to root. Let’s dig into that. Adding a user with a group (wheel) You’ve on-boarded a new admin, and you need to make them an administrator on a file server. The … Read more

Home » Linux » Shell

How to Use “if… else” in Bash Scripts (with Examples)

if else bash

Bash scripting is a vital tool for developers to automate tasks in Linux. Bash scripts can be used to automate development tasks locally (like uploading files for deployment, compiling apps, or resizing images in bulk), as well as for server-side tasks (sending scheduled emails, collecting data at intervals, or sending notifications to devices). You’ll want to run some tasks dependent on the outcome of another task or variable, and that’s where if … else will help you. This decision making process in Bash scripts is called using conditionals. … Read more

Home » Linux » Shell

Linux cp Command: How to Copy Files and Directories

Linux cp command How to copy files and directories

In this tutorial, we explain how to use the cp command in Linux to copy files or directories. Examples are included below. Linux is one of the most popular Operating Systems on the planet and is the basis for all Android devices. It is open-source and has some clear advantages over other systems such as Windows or macOS. Within Linux, there are a considerable number of different commands that programmers use regularly. What is the cp command? The copy (cp) command is one of the … Read more

Home » Linux » Shell

Debian: How to Add a User to Sudoers

Debian How to Add a User to Sudoers 1

In the Filesystem Hierarchy Standard used by Linux operating systems, all files and directories appear under the root directory “/” but access to it is often restricted for security reasons. In Linux distributions like Debian, you can gain full access from the SSH by using the “sudo” command. This tutorial explains how to add a user to Sudoers so that the user is permitted to run the sudo command. Logging in as a superuser or root user enables you to make system-wide modifications. “sudo” can … Read more

Home » Linux » Shell

Linux tr Command with Examples

linux tr command 1

In Linux and Unix systems, tr is a command-line utility that translates, erases, and “squeezes” repeated characters – in fact, tr stands for “translate.” This guide explains how to use the tr command in Linux, with examples. It can be used for operations such as removing repeated characters, converting lowercase to uppercase, and basic replacing and removing of characters. It is often used in conjunction with other commands through piping. Linux is the basic kernel/operating system core behind much of the technology we use on … Read more