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 Compare Arrays in JavaScript, With Examples

Compare Arrays in JavaScript

This article will show you how to compare arrays in JavaScript and provides some ready-to-use functions to do so. We’ve already covered a bit on how to use arrays in JavaScript: Looping over Array using JavaScript forEach(), With Examples Array slice() Method in JavaScript, with Examples() Check Array Contains a Value in JavaScript, with Examples Removing an Element From an Array in JavaScript, with Examples What is an Array? An array is a type of JavaScript variable that can hold other variables, or references to … Read more

JavaScript instanceof Operator – What it Does, How to Use It

JavaScript instanceof Operator

This article will explain what the JavaScript instanceof operator does and how it can be used. Examples provided. What does instanceof do? The instanceof operator returns TRUE or FALSE depending on whether a given value or variable is of a certain type or class – it checks whether a value is an instance of a given object class or type. The purpose of instanceof may seem confusing – you already have typeof, so what do you need instanceof for? typeof will simply return a string containing the name of the type or class of the variable. In contrast, instanceof will return a … Read more

Refresh or Redirect a Page using PHP, With Examples

PHP Refresh Page

This article will show you how to refresh a web page in the browser using the PHP programming language. It’s sometimes necessary to set a page to reload automatically, usually at some interval, to keep the page updated with changing information. For example, you may have a scoreboard application that is displayed in a web browser on a projector and wish to have it periodically refresh to keep the displayed scores up to date with those stored. Periodic refreshing is also used to redirect to … Read more

Categories PHP

How to Get CPU Information on Linux, With Examples

Get CPU Info in Linux

Here’s how to display the CPU info for your computer on Linux from the Linux command line. The CPU (Central Processing Unit) in your computer does all of the number crunching and processing and logic that your computer needs to do to, well, compute. It’s the brains of the whole operation. The type of CPU, how old it is, and how fast it is determines how responsive your computer is and how quickly it can do things. CPU Info From /proc/cpuinfo One of the core … Read more

List Running Processes in Linux with ps, top, or htop

Linux List Processes

This article will show you how to list running processes in Linux using several tools. This will allow you to see what is running and how your system resources are being consumed. It’s helpful to see what resources are in use by what process to diagnose slow systems. This information can be used to determine whether you need to purchase more memory (RAM), a faster processor, or whether an application or service on your computer is misconfigured and using more resources than it should. What … Read more

tee Command in Linux – Split Shell Output [Examples]

Linux tee Command

The tee command in the Linux Shell/command line splits the output of an application – sending output to both a file and STDOUT (the console or another application). Here’s how to use it. The tee command is named for a T-splitter used in plumbing – a pipe that redirects water from a single source in two directions. tee Command Syntax tee is a command with a simple purpose and simple syntax: tee OPTIONS FILE Note that: OPTIONS is a list of options from the below table FILE is the path to … Read more

Linked Lists in Python – How to Use Them, With Examples

Python Linked Lists

This article will explain in simple terms what linked lists are, why they’re useful, and how to use them in the Python programming language. Lists In Python, a list is an array of data – a simple list of values where each item has a value and a position in the list. Lists are indexed (so the positions start counting at position 0, not 1). For more information on lists in Python, check out these LinuxScrew articles: Python List ‘sort()’ Method – Sorting Lists in Python Easily … Read more

The uniq Command In Linux – Tutorial and Examples

Linux uniq Command

This article will explain how to use the uniq command in Linux to find or filter repeated lines in files and provide some usage examples. The uniq command is a simple command which either outputs or omits repeated lines in the supplied input or file. uniq Command Syntax The syntax for the uniq command is as follows: uniq OPTIONS INPUT OUTPUT Note that: OPTIONS is a list of options from the below table INPUT should be the path to the file to be read *Standard input *can also be used OUTPUT should be … Read more

Multidimensional Arrays in PHP – How To Use, With Examples

PHP Multidimensional Arrays

This article will show you how to use multidimensional arrays in the PHP programming language, explaining what they are and how to use them. What is an Array? An array is a type of PHP 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 … Read more

Categories PHP

Converting a List to a String (and Back!) in Python [Examples]

Python List to String

This article will show you how to convert lists to a string in the Python programming language. Why would you want to convert a list to a string? Most commonly, because you want to print it or because you want to store it in a database text field or a text file. Converting List to String in Python The join() string method will take a list or iterable in Python and join each element, using the given string as a separator between each element. # Define a list of strings myList … Read more