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

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

How to Make Multiline Comments in Python

How to make multi line comments in Python

In this tutorial, we explain the two methods used to make multiline comments in Python, with examples. There are some drawbacks to one of the methods, so pay attention. Code without comments is like a story written in a language you only half understand. You might be able to figure out the main points, but you’ll miss some nuances and it would be way easier with a translation alongside it. Most coders hate code with no comments or limited comments, so finding ways to clearly … Read more

How to Save a File and Quit in Vim/Vi

How to Save a File and Quit in Vim Vi

In this guide, we explain how to save a file and quit/exit in Vim, how to save a file without exiting, and how to quit/exit without saving. Vim (Vi IMproved) is an open-source text editor for Unix or Linux. It’s used to write and edit text, either in the command line interface or independently through a GUI. It’s a great tool and like any software tool, one of the first things to learn about it is how to safely exit without losing all of your … Read more

Python: How to Check Whether a File or Directory Exists

Python How to check whether a file or directory exists

In this article, we explain how to check whether a file or directory exists in Python and include some useful examples to help you get started. Python is a high-level programming language with dynamic semantics. Developed in the early 90s, and named after the Monty Python comedy troupe, it uses simple, easy-to-learn syntax and remains very popular amongst the programming community. It is particularly attractive for Rapid Application Development (RAD) and for its ability to connect existing components together. Python can be used for: server-side … Read more

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

How Change the Timezone in Linux

How Change the Time Zone in Linux

Linux is the world’s most widely used open-source operating system (OS). Because Linux is open-source, it means that the code is free and available to the public to view/use. Android, one of the most popular platforms on the planet, is powered by Linux. As such, Linux is used across the world in every time zone. In this article, we’ll explain how time zones work in Linux, and how to change the time zone. Time zones A time zone is a region/area in which the same … Read more

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

How to Grep for Multiple Words, Strings and Patterns

How to Grep for Multiple Words Strings and Patterns 1

This guide explains how to use the grep utility for searching multiple words, strings, and patterns. You can find full examples of the commands used to accomplish this below. What Is Grep? When we refer to grep, we’re talking about the command-line function. Grep stands for Global Regular Expression Print. In essence, it will search input files looking for lines that are a match to a certain regular expression. It then returns results by writing each line for standard output. The grep utility is suitable … Read more

How to Get CPU Information on Linux

how to get cpu information linux

Within your computer, the central processing unit, aka the CPU, is a critical component. Despite its essential nature in performing countless data processing functions, many of us likely know very little about the CPU, hidden away inside the computer out of sight as it works its magic. Thankfully, finding CPU information on Linux systems is fairly straightforward, so let’s take a look at how it’s done. Why You Might Need CPU Information There are a few reasons why someone may want to obtain further CPU … Read more

How to Convert a String to int in Python (and Int to String)

how to convert string int python 1

This article explains how to convert a string into an integer in Python. When you are looking to program with Python, it’s essential that you are aware of the different data types that you may be dealing with. The way your data is stored will depend on which kind of data it is and each kind of data operates in a different manner. Different data types in Python Data types that you’re likely to encounter fall under the categories of numeric, string, and boolean. Simply … Read more