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

Move Files With the mv Command in Linux, With Examples

Linux Move File mv

This article will walk you through moving files in Linux with the mv command, with examples and tips on moving files safely. mv Syntax Moving files is done using the mv command, which has the following syntax mv OPTIONS SOURCE DESTINATION Note that: OPTIONS is a list of options from the below table SOURCE is the path to the file you wish to move DESTINATION is the path to the destination you want to move the file 2 This can include a new file name or simply be the path to a … Read more

PHP vs HTML – What’s The Difference? Which Should You Use?

PHP vs HTML

This article will explain the difference between PHP and HTML and outline which you should use for your project (probably both – and I’ll explain why). If by the end of this article you’re still trying to navigate your way through the different web programming languages, check out these other explainers: jQuery vs. JavaScript – Differences? Which is Better? PHP vs. JavaScript – The Best Choice For Your Project TypeScript Vs. JavaScript – What’s the Difference & Which Should You Use? MySQL vs. MariaDB vs. … Read more

Categories PHP

How To Run a Python Script (Python 2/3)

How to Run Python Scripts

This article will show you how to run both Python 2 and Python 3 scripts in Linux and find out what versions of Python are installed. Running a Script To run a Python 3 script: python3 /path/to/script.py To run a Python 2 script: python2 /path/to/script.py Read on to find out how to install Python and find out which versions you have installed. Installing Python on Linux You can see what Python packages are installed on your system by running the following commands: which python which … Read more

Unix vs Linux – What’s the Difference?

Unix vs Linux

Here’s a quick summary of Unix and Linux and what makes them different, and ways you can try them out. Different products, similar uses What is Unix? Unix was developed in the 1970s by Bell Labs as an Operating System for developers. Over time features such as multitasking and support for multiple users were added, turning it into a versatile operating system popular with universities. The modular development of Unix lead to the Unix Philosophy – an emphasis on modular, reusable code and handling files as … Read more

Checking Whether a String Contains a String in Python, With Examples

Python String Contains

This article will show you how to check if a string contains another string in the Python programming language. PHP and Javascript both have similar functions included: PHP strpos Function: Check if a String Contains Another String Javascript String includes() Method – Check if a String Contains Another String Python has several methods for accomplishing the same thing – read on for how to do it. Using in to Check if A String Contains a String in Python The fastest and best way to check if a … Read more

Passing Variables by Reference in PHP, with Examples

PHP Pass Variable By Reference

This article will explain how to pass a PHP variable by reference and why you might want to do it – with some examples. What is a Variable? You probably already know this one. A variable stores a value – it has a name, and you can use that name to refer to the variable and the value it contains. In PHP, variable names are prepended with a $ (dollar symbol) and must contain only numbers, letters, dashes, and underscores: $variableName = “Variable Value”; Variable Behaviour in … Read more

Categories PHP

Exiting Bash Scripts with the exit Command, With Examples

Bash Exit Script

Bash/Shell scripts usually run sequentially until all of the code in the file has been executed. The exit command will exit the script before this based on conditions of your choosing. exit Command Syntax Here’s the syntax for the exit command, which can be used in Bash/Shell scripts: exit STATUS Note that: STATUS is an optional parameter that sets the exit status of the script The exit status tells other programs whether the script executed successfully or not It will default to either 0 or the exit status of the last command executed by … Read more

Arch Linux vs Ubuntu Linux – Which is To Choose?

Arch Vs Ubuntu

This article will explain Linux Distributions, Ubuntu, and Arch Linux, and give you some information to help choose between them. Linux Distributions The Linux Kernel is the core of the Linux Operating System – it handles the basic operations and interfaces with the computer hardware allowing software (like desktop interfaces, web browsers, and word processors) to run on top of it. On its own, the average user can’t do much with the Linux Kernel alone. A Linux Distribution (or distro for short) is an Operating System that … Read more

Array Variables in Bash, How to Use, With Examples

Bash Array

We’ve covered using variables in Bash previously – this article will explain Bash array variables and provide some example usage. What is an Array An array is a type of variable that can hold multiple values. It’s a list of values you can loop through and perform operations on each individual value. For example, you might want to perform an action on a list of files. By storing that list as an array, you can loop through the file names in it and perform the action on each … Read more

Using The isNaN() Function in JavaScript, With Examples

JavaScript isNan()

isNaN() is a JavaScript function that will tell you whether a value is equal to NaN – or Not a Number. It can be used to determine whether the result of a mathematical operation is valid or not. Here’s how to use it. What is NaN? NaN is a special value that means Not a Number. It means that a value that should be a number could not be parsed as a number. Any mathematical operation between any other value and NaN will result in NaN. It usually means something has … Read more