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

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

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

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

Best Raspberry Pi and Pi Zero Projects – Upgrade Your Home With Our Favourite Picks

Best Raspberry Pi and Pi Zero Projects

Looking for some home projects to keep you occupied over the winter months? LinuxScrew has you covered with this collection of Raspberry Pi projects for your home! Best Raspberry Pi Projects Raspberry Pis are cheap single-board computers that can be used for a variety of tasks – from desktop computers to web servers, and automation. Read on for some great projects for your home that utilize the Raspberry Pi and Pi Zero. Raspberry Pi CCTV System Turn a raspberry pi and a USB webcam into … Read more

How to use ‘try/catch’ in PHP (with Examples)

'try/catch' in PHP

PHP is one of the most popular programming languages used to develop web applications and APIs. Linux is the system of choice for serving up your PHP code and is also an ideal PHP development environment. When writing PHP code, you’ll sometimes want to perform a certain action when an error is encountered (rather than just sending the user an error message and halting code execution). This is exactly what try/catch is used for in PHP. Syntax try { // Code to attempt } catch (Exception $e) { … Read more

Categories PHP

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

"if... else" in JavaScript

JavaScript has quickly become one of the most popular programming languages due to its ease of use and flexibility – it can be run in just about any web browser on any device making it perfect for cross-platform apps. Linux is the most popular platform for hosting JavaScript Apps built with Node.js and is a great platform for developing both standalone JavaScript programs and browser-based solutions. If you’re learning JavaScript the if… else control structure is one of the first things you’ll want to get the hang … Read more

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

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

Arduino vs Raspberry Pi: What are they and which one should I use?

arduino vs raspberry pi 1

This article explores the differences and common uses for the Raspberry Pi and Arduino hardware platforms. You’ll see a lot of talk about “Arduino vs. Raspberry Pi” as if they’re competing products – but they’re not! Arduinos and Raspberry Pis may both have started as small, affordable teaching platforms, but their intended uses are different, and they have diverged into two families of products with very different features that can do very different things. Check out the guide below to help you decide which one to choose for your next project. … Read more

How To Remove Items From A List in Python (With Examples)

python remove items from list

Python is widely used for both scripting and automation on Linux, as well as building web and standalone applications. Python is designed to be easy to learn, easy to write, and easy to read. It’s a great multi-purpose programming language. Python has several different types of arrays for storing data. Lists are arrays which allow you to store items. Items in lists can be altered, and are stored in a specific order. Syntax and Examples There are several methods you can use to remove an … Read more