Home » Linux » Shell

Linux chmod Recursive: How to Change File Permissions Recursively

Linux chmod Recursive

With the Linux chmod command, we can recursively change file permissions on all files and directories. This guide explains how. It’s likely you’ve run into the following errors before: 111 [Permission Denied] “Linux-Screw” [Permission Denied] “Linux-Screw” [readonly] For any system files, using sudo is the preferred way of editing a file. This allows you to keep all the system context. For everyday use with user files, it’s best to change permissions. chmod can do that for us. It keeps us from needing to escalate permission … Read more

Home » Linux » Shell

Linux Change User Password (passwd)

Linux Change User Password

This tutorial explains how to use the Linux passwd command to change a user password or disable an account. You’re assigned a ticket: A simple password reset, but it’s for a Linux machine. What do you need to know to reset a password on Linux? First the basics. For users, the passwd authentication token is store in the /etc/shadow file. For groups, it’s stored in the appropriately named /etc/gshadow file. passwd allows you to change passwords for either. The normal usage of passwd is: Reset … Read more

Home » Linux » Shell

ls Command in Linux to List Files and Directories

ls Command in Linux

The ls command in Linux is likely one of the first commands you ever need to use. In this article, we’ll go over the command and commonly used parameters. My preferred set of options is as follows: ls -Zaltrh Let’s dig into each option individually, and explain why the entire glob of options is helpful. Linux LS Command Syntax #ls [OPTION] [FILE] OPTIONS: [-a], do not ignore entries starting with . or .. [-h], with -l, print sizes in human readable format (e.g., 1K 234M … Read more

Home » Linux » Shell

Using the ‘pwd’ Command in Linux, with Examples

Using the ‘pwd’ Command in Linux

Whether you’re developing Python apps on Linux, or just organizing your files from the shell, it’s important to be able to find out which folder you are currently navigating. The pwd command will do that for you – it prints the name of the current directory you are navigating in the terminal – including its full path. This is extremely useful in any Linux environment as it will remove all confusion about which folder you’re in, as it’s very common for there to be multiple folders of … Read more

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