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 Use the userdel Command to Remove Users in Linux

linux tux

Like most modern operating systems, Linux is designed to be a secure multi-user system. Each system, therefore, needs a system administrator with the ability to manage user accounts. That means creating accounts, assigning privileges to them, and deleting them when they are no longer required. It is always best practice to delete the accounts of dis-continued users (provided that you are sure there is nothing in the account that could be needed again). A user account can consist of numerous things, including the user’s home … Read more

How to Append to File in Bash

append file bash

There are several ways to append text or new lines to a file using the Bash command line. The majority of them use the double >> to redirect output from another command (such as “echo” or “printf“) into the designated file. An alternative method, using “tee“, can be used when your new text is already available from another input source – usually another text file. Whenever you use any of the redirection methods, always take care not to mistype a single arrow > when you … Read more

How to Use Split in Python to Split a String

python logo

Python is the world’s second most popular programming language and is the preferred choice of many programmers. It is particularly useful for backend web development, artificial intelligence, data analysis, and scientific computing, but can also be used for creating games and desktop apps. One of the most common questions when it comes to Python is how to split a string. A string in Python is a sequence of Unicode characters, and string variables can be very helpful for Python programmers. They can contain alphanumeric or … Read more

How to Check the Current PHP Version

PHP Logo

Almost eight out of ten websites use PHP (according to W3Techs) and most are WordPress sites – yet 64% are using old versions no longer officially supported. Considering the latest versions are faster and safer from hacking, it makes sense for every webmaster to keep on top of updates. At the time of writing, the latest version of PHP is 7.4.8, and version 8.0.0 is in alpha. The catch with upgrading is that new conflicts can arise, usually from code that has only been tested … Read more

Postgresql: show tables, show databases, show columns, describe table

PostgreSQL is one of the best database engines for an average web project and many who moves to psql from MySQL (for example) often ask the following questions: What is the analog of “show tables” in Postgres? How can I get the list of databases in Postgres like “show databases” in MySQL? In this quick tutorial, we’ll answer these questions, along with some other common commands which are useful. PostgreSQL doesn’t work with original MySQL commands, but it gives similar functionality with its own commands: … Read more

Git: How to Remove a Remote

git logo

What Is A Git Remote? A remote within the control system Git is a common repository utilized by all users when exchanging changes that have been made. The git remote is essentially a pointer referring to a cloned version of the user’s project that is typically hosted remotely, such as on another network or a remote server. The remote repository is given the shorthand convention ‘origin’, which you may see referenced in the commands. If you’re working within a group on a project, multiple remotes … Read more

The Zip Command in Linux: How to Zip Files and Directories

zip files and directories in linux

If you’re looking to archive your files and directories, regardless of your OS, “zip” is the format that is most popular and supported by the largest number of clients and operating systems. In this tutorial, we’ll go over how to use the applications in Linux to compress files and directories. The zip file format supports lossless data compression. Its origins go back to 1993, designed by Phil Katz of PKWARE and Gary Conway of Infinity Design Concepts. Compressing your data has multiple benefits, namely: less … Read more

Why is the Linux Logo a Penguin (Tux)?

The Beginning The use of a Penguin as logo/mascot for Linux was discussed first in early 1996 by several people in the linux-kernel mailing list. The idea of such a mascot came from Alan Cox first. Among many other suggestions made by different people, there were parodies of other operating system logos, sharks, or even eagles. You can find them here, and here’s a couple below: In May, 1996, Linus Torvalds casually mentioned that he was rather fond of penguins and it stopped the debates … Read more

Linux Restricted Shells: rssh and scponly

security

Restricted shells like rssh and scponly give sysadmin the possibility to limit the operations that Linux user can do, for example you can create user that will be allowed to copy files via scp but won’t be permitted to login into system’s command line. This is quite important security feature that should be considered by every sysadmin to prevent unauthorized activity by users for example over SSH. If you have some online storage that is used for uploading backup data over scp or rsync/ssh from remote hosts then … Read more

Track file changes using auditd

command line

Most of Linux distributions comes with Linux Auditing System that makes it possible to track file changes, file accesses as well as system calls. It’s pretty useful functionality for sysadmins who wish to know who and when accessed and/or changed sensitive files like /etc/passwd, /etc/sudoers or others. Daemon auditd that usually runs in background and starts after reboot by default logs those events into /var/log/audit.log file (or into other file if different syslog facility is specified). The common usage is to list all files which should … Read more