Welcome to LinuxScrew

A site for Linux lovers worldwide. For newbies, system engineers, administrators, and everybody in between. We cover all things Linux, plus various programming languages, including Python, Javascript, and PHP.

View our featured tutorials and projects in the slider below or scroll down to see all recent articles.

How to Convert a USB Printer to Wireless with a Raspberry Pi
How to Use a Raspberry Pi for Digital Signage
The Worst Things You’ll Probably Google As a Programmer on Linux
How to Build a Raspberry Pi Internet Kiosk
Browsing the Internet on a 1989 Macintosh II with a Web Rendering Proxy
previous arrow
next arrow
Slider

Concatenating (Joining) Strings in Python

string concatenation python

Let’s look at two ways you can concatenate (which is a fancy word for join or merge) two or more strings in Python. It’s also worth checking out our article on converting integers to strings in Python. A Note On Immutable Strings Strings in Python are immutable and cannot be changed once defined. This means that whenever you join two strings, a new string is created (ie. the original is not modified!). This has both performance side effects and affects how you should structure your code: … Read more

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

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

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

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

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

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

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

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

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