Home » 2020 » November

Escape Characters in Python, With Examples

Escape Characters in Python

Every programming language has special characters that trigger certain behaviors in your code – and Python is no exception. These characters cannot be used in strings (as they are reserved for use in your code) – and must be “escaped” to tell the computer that the character should just be treated as a regular piece of text rather than something that needs to be considered while the code is being executed. If you want to be able to leave yourself notes in your code, check … Read more

Home » 2020 » November

Measuring the Length of a String in JavaScript, with Examples

Measuring the Length of a String in JavaScript, with Examples

In this guide, we explain how to measure the length of a string in JavaScript using the length method. JavaScript is a flexible programming language that runs just about everywhere. You can run JavaScript apps in web browsers, build command-line apps you can run in the terminal, mobile apps can be built using platforms like Cordova, and server processes can be written on platforms like Node.js. Naturally, Linux is the environment of choice for many JavaScript developers and is perfect for learning tools like Node.js … Read more

Home » 2020 » November

Check Array Contains a Value in JavaScript, with Examples

Determining Whether an Array Contains a Value

This tutorial will show you how to check whether an array contains a specific value in Javascript, with full examples. JavaScript is a flexible programming language that runs just about everywhere. You can run JavaScript apps in web browsers, build command-line apps you can run in the terminal, mobile apps can be built using platforms like Cordova, and server processes can be written on platforms like Node.js. Naturally, Linux is the environment of choice for many JavaScript developers and is perfect for learning tools like … Read more

Home » 2020 » November

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 » 2020 » November

Vim / Vi: Deleting lines

Vim / Vi: Deleting lines

This tutorial will teach you how to delete single, blank, or multiple lines in Vim / Vi by using a pattern or range. Vim is ubiquitous, and it’s everywhere. Learning how to edit, remove, yank, paste, and everything else can help you speed through tasks. Before we get started, let’s turn on line numbers: Press ESC (pressing escape brings you into normal mode) Type :set number (brings you into command mode) Line numbers, voila! Simple Deletion The two basic usages of the d-shortcut, delete a single … Read more

Home » 2020 » November

Removing an Element From an Array in JavaScript, with Examples

Removing an Element From an Array in JavaScript

There are multiple ways to remove an element from an array in Javascript. We cover all of the methods that can be used in this tutorial. JavaScript is a flexible programming language that runs just about everywhere. You can run JavaScript apps in web browsers, build command-line apps you can run in the terminal, mobile apps can be built using platforms like Cordova, and server processes can be written on platforms like Node.js. Naturally, Linux is the environment of choice for many JavaScript developers and … Read more

Home » 2020 » November

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 » 2020 » November

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 » 2020 » November

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 » 2020 » November

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