These are my general Linux notes.
- General
- 10 Things I Wish I Knew When I First Started With Linux - YouTube | Learn Linux TV - Working with Linux servers is a fun and rewarding career. But for those getting started, the learning process can be a bit of a challenge to navigate. In this video, Jay goes over ten things he wish he knew about Linux when he first started.
- Two main branches of Linux
- RHEL = RHEL, AlmaLinux, Rocky Linux, CentOS, CentOS Stream
- Debian = Debian, Unbuntu, Linux Mint
- Linux Mint is based on Ubuntu and is set to be a Windows replacement with emphasive on the GUI.
- Apache (and associated)
- Restart apache
- Simple as
systemctl restart apache2 or service apache2 restart or service httpd restart
- Simple as
- How to enable php modules
- How To Enable/Disable PHP Modules In Ubuntu - TecAdmin - How do I Enable/Disable PHP Modules on Ubuntu 22.04, 20.04 & 18.04 systems? Enable or disable a PHP module for specific PHP versions.
phpenmod MODULE_NAME phpenmod gd apt-get install php-gd apt install php8.1-gd
- Installing PHP modules on Linux | UKFast Documentation - A guide to installing PHP modules on Linux
yum install php-soap
- How to install PHP GD in Ubuntu - Stack Overflow
Common sudo apt-get update For 5.6 PHP: sudo apt-get install php5.6-gd For 7.0 PHP: sudo apt-get install php7.0-gd For 8.0 PHP: sudo apt-get install php8.0-gd All versions ? apt-get install php-gd
- How To Enable/Disable PHP Modules In Ubuntu - TecAdmin - How do I Enable/Disable PHP Modules on Ubuntu 22.04, 20.04 & 18.04 systems? Enable or disable a PHP module for specific PHP versions.
- List Apache modules
- Restart apache
- Text Editors
- Command-line text editors in Linux
- There are two command-line text editors in Linux®: vim and nano.
- This article covers the basics of each editing tool and how they differ including shortcuts.
- Command-line text editors in Linux
- Server Management
- Permission denied during updates
- 13: Permission Denied During Updates | Linode Questions
- You need sudo for each command:
sudo apt-get update && sudo apt-get upgrade -y
- You need sudo for each command:
- 13: Permission Denied During Updates | Linode Questions
- Reboot Linux System Command - nixCraft - Explains how to reboot a Linux server / desktop computer from a shell prompt including remote system over ssh based session.
reboot
- Shut down your server
poweroff shutdown
- How to Run Cron Job Every Minute - A Complete Guide - Learn to set up a cron job every minute with this comprehensive guide, offering detailed steps and explanations. Perfect for beginners and experienced users alike.
- Permission denied during updates
- File Locations
- Nameserver
/etc/resolv.conf
- Nameserver
- SSH
- How to Use SSH to Connect to a Remote Server in Linux or Windows - In this tutorial, you will learn How To Use SSH to Connect to a Remote Server in Linux or Windows. Get started with an SSH connection to a Server Today!
- How to Enable, Install, & Configure SSH on CentOS 7 | PhoenixNAP KB - Tutorial on how to Enable, Install, & Configure SSH on CentOS 7. Enabling secure shell allows a secure connection to your remote server. Get started!
sudo yum –y install openssh-server openssh-clients
- File Management
- How to Compress a File in Linux (tar, gzip, bzip2) - Learn how to compress files in Linux using tar, gzip, and bzip2 commands. This tutorial provides easy steps for data compression, saving storage space effectively.
- How to delete and remove files on Ubuntu Linux - nixCraft - This page shows how to delete and remove files on Ubuntu Linux and other Unix-like operating systems using rm and unlink command.
- How To Find a File In Linux From the Command Line - Plesk Tips - The Linux Find command can filter objects recursively using a simple conditional mechanism, and if you use the -exec flag, you’ll also be able to find a file in Linux straightaway and process it without needing to use another command.
- Networking
- See your IP in terminal
- How to get your Linux IP address - IONOS - You have several options when it comes to finding your Linux IP address. Our article shows you the most practical way to get it using commands or settings
ip addr ip a
- How to get your Linux IP address - IONOS - You have several options when it comes to finding your Linux IP address. Our article shows you the most practical way to get it using commands or settings
- Configuring a Static IP Address in CentOS - Learn how to configure a static IP address in CentOS with this easy-to-follow tutorial. This guide offers step-by-step instructions for beginners and experts alike.
- Loopback Device
- This is what provides 127.0.0.1 but can be used for real IP addresses.
- linux - How does the loopback interface work - Unix & Linux Stack Exchange
- The loopback interface is a virtual interface. The only purpose of the loopback interface is to return the packets sent to it, i.e. whatever you send to it is received on the interface. It makes little sense to put a default route on the loopback interface, because the only place it can send packets to is the imaginary piece of wire that is looped from the output of the interface to the input. There is nothing that can change this behaviour of the loopback interface, that's what it is coded to d
- A real world example how this works (excellent)
- lo = loopback interface
- networking - What is the loopback device and how do I use it? - Ask Ubuntu
- What are loopback and localhost? Why do they exist, what are they used for, and how would I use them?
- The Purpose of Loopback..... a great explanation
- For IPv4, the loopback interface is assigned all the IPs in the 127.0.0.0/8 address block. That is, 127.0.0.1 through 127.255.255.254 all represent your computer. For most purposes, though, it is only necessary to use one IP address, and that is 127.0.0.1. This IP has the hostname of localhost mapped to it.
- Does NOT show how to assign a real IP
- The Loopback Interface | The Linux Documentation Project
- networking - How can I create Logical Loopback on Ubuntu? - Ask Ubuntu - How can I create a logical local loopback like the procedure here for a Juniper router. (Not talking about 127.0.0.1).
- Loopback Adapter on Ubuntu 18.04 (Like on Cisco) – Question Computer
- In any case, I’ve been using a method to create loopback adapters on Ubuntu Server and Desktop well before Netplan came along, simply because it’s the way I learned and it seems to work no matter what distribution or version I’m using.
- Loopback adapters are useful for all sorts of stuff in networking. You can create one, give it an IP address and advertise it in a routing protocol like OSPF, for example. Unlike physical interfaces, loopback adapters are much, much less likely to “go down”.
- On Ubuntu 18.04, you can add a “dummy” adapter with a single command like this......Then turn it on and give it an IP address.
- networking - How can I create Local Loopback on Linux? - Unix & Linux Stack Exchange - I need to create local loopback as shown herein: Performing Loopback Testing for Fast Ethernet and Gigabit Ethernet Interfaces.Excerpt
- 12.04 - How to add a loopback interface? - Ask Ubuntu - I want to add two more loopback interfaces.
- linux - How to add a second local loop_back address? - Super User
- I already have a loopback address at 127.0.0.1, which corresponds to a host in the local loopback network 127.0.0.0/8. How could I create a second local loopback host with an address of 127.0.0.2? Does anyone knows the exact command?
- Can add it temporary using below command.....
- Add them permanently to /etc/network/interfaces
- Is it possible to put a real IP on a loopback device? - Unix & Linux Stack Exchange - Is it possible to put a real IP (not in the 127.x.x.x) range on a loopback device?
- networking - How to configure IPVS loopback address with netplan in Ubuntu 18.04? - Ask Ubuntu - Previously, I configured IPVS loopback addresses in /etc/network/interfaces like this........
- See your IP in terminal
- Installing (Packages)
- How to Install Bind DNS on Ubuntu 20.04 Server (Setup / Configure)
- How to Install Bind DNS on Ubuntu 20.04 Server (Setup / Configure). BIND server is the most popular Domain Name System (DNS) server in use today. BIND is used to run a caching DNS server or an authoritative name server and some features are: load balancing, dynamic update, notify, split DNS, DNSSEC, IPv6.
- We will walk you through the topic what is DNS Server and how does it work and introduce Bind DNS server with its pros and move onto install phase on Ubuntu 20.04. Let’s start!
- This outlines BIND's features
- How to install curl command on Ubuntu Linux - nixCraft - Explains how to install the curl command on a Ubuntu Linux system using apt or apt-get command to transfer data from or to a server.
$ sudo apt update - this populates the local packages index $ sudo apt upgrade - this upgrades your system (optional, you can do this in the panel later) $ sudo apt install curl - this installes the curl package
- ssh - How can I check the version of BIND on Debian - Unix & Linux Stack Exchange
You can ask dpkg for the packages's version: dpkg -l bind9 or directly to BIND's binary: sudo named -v
- Install and configure Postfix and Dovecot | Linuxize - Postfix is an open-source mail transfer agent (MTA), a service used to send and receive emails. Dovecot is an IMAP/POP3 server and in our setup it will also handle local delivery and user authentication.
- [Dovecot] How Can I Tell How Dovecot Was Installed?
dovecot --version
- How to Install Bind DNS on Ubuntu 20.04 Server (Setup / Configure)
- The Repos
- Ubuntu – Ubuntu Packages Search
- Packages for Linux and Unix
- OpenSUSE Application Data Review
- Arch Linux - Package Search
- AlmaLinux OS RPM package sources
- packages.microsoft.com
- EPEL
- Extra Packages for Enterprise Linux (EPEL) :: Fedora Docs - Learn more about Fedora Linux, the Fedora Project & the Fedora Community.
- What's EPEL, and how do I use it? - Most people know that Fedora is the upstream for major releases of Red Hat Enterprise Linux (RHEL). You might also notice that Red Hat ships a smaller package set for RHEL than you'll find with Fedora, for a number of reasons. What if you're a Fedora user who also wants ImageMagick or Chromium on your RHEL workstation? You may want to take a look at EPEL.
- RHEL ships with only a subset of packages that you'll find in Fedora Linux. This makes sense, because there's a lot of software in Fedora that isn't needed in an enterprise environment or falls outside the scope of RHEL. Red Hat maintains and supports the packages in RHEL far longer than the lifespan of a Fedora release, and we select the software we feel is necessary for our customers to be successful in deploying and using RHEL to run their workloads.
- What's inside an RPM .repo file? | Red Hat Developer - The previous article in this series, How does RPM package discovery work?, described how the RPM package management technology discovers and installs an .rpm
- Package Management
- The repo commands are one of the main differences between Linux distros along with pre-installed packages and desktop environments. The kernel is the same, but different flavours might have a different revision depending what point in the release cycle the distros are.
- 3 Options to List All Installed Packages in CentOS {Easiest Way} - Updated tutorial walks you thru How to List all Installed Packages on CentOS (RHEL and Fedora) with Yum, RPM, or yum-utils. Get started now!
- How to use apt or apt-get for CentOS/RHEL - GetPageSpeed
- Here's how to use apt-get to install and remove packages in CentOS. If you know Ubuntu, you can easily jump on board CentOS/RedHat with this simple guide.
- lists different update manage commands
- apt Command Examples for Ubuntu/Debian Linux - nixCraft - 19 examples of apt command on Debian/Ubuntu Linux server to install/remove packages and update the system for Linux users/sysadmins/developers.
- Ubuntu Manpage: apt - command-line interface
- Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively.
- Difference Between YUM and DNF | Difference Between - As RPM based applications including Red Hat Linux grew in popularity, it became more important than ever to make package installation less challenging. The answer was YUM. But it ran into some problems after a while, so it was replaced by a faster and better DNF package manager.
- Package Managers in Linux and Windows - Package managers allow you to quickly install, manage, and delete programs (or apps, applications) from your operating system within a command-line interface. Different distros provide a variety of package managers, but all are straightforward.
- GitHub - sigoden/upt - Universal Package-management Tool for Windows, macOS and Linux.
- debian - what is the function of /etc/apt/sources.list.d? - Stack Overflow
- Using the directory, you can easily add new repositories without the need to edit the central /etc/apt/sources.list file. I.e. you can just put a file with a unique name and the same format as /etc/apt/sources.list into this folder and it is used by apt.
- This is why the repos do not show up in the package updater thing, but it also does not affect them working.
- Ubuntu Manpage: sources.list - List of configured APT data sources
- How To Add Apt Repository In Ubuntu | Linuxize - In this tutorial, we will show you two ways to add apt repository on Ubuntu and Debian systems. The first method is by using the add-apt-repository command and the second one is to manually add the repository using a text editor.
- APT Deprecated
- apt-key Is Deprecated. How To Add OpenPGP Repository Signing Keys Without It On Debian, Ubuntu, Linux Mint, Pop!_OS, Etc. - Linux Uprising Blog - This article explains how to securely add OpenPGP keys and third-party APT repositories on Debian, Ubuntu, and Linux distributions based on these, like Linux Mint, Pop!_OS, Elementary OS and so on, to replace the deprecated apt-key.
- The repos should on be https:
- This has some in depth instructions.
-
curl https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > /usr/share/keyrings/signal-archive-keyring.gpg
- [Fixed] apt-key is deprecated. Manage keyring files in trusted.gpg.d - The apt-key is being deprecated and your system knows that. But do you know what you should do to get packages from external repositories?
- repository - What commands (exactly) should replace the deprecated apt-key? - Ask Ubuntu
- All of the answers so far work around the symptom ("Don't use apt-key add") but fail to address the actual problem that led to apt-key add being deprecated. The problem is not a question of appending a key to one big keyring file etc/apt/trusted.gpg vs manually putting single-key keyring files into the directory /etc/apt/trusted.gpg.d/. These two things are equivalent, and doing either one is a huge security risk.
- Fix the apt-key deprecation error in Linux | Opensource.com - Follow these steps and you can run apt update with no warnings or errors related to deprecated key configurations.
- How to fix the apt-key deprecated warning in Ubuntu - Jack Wallen shows you how to fix a common apt-key warning when trying to update/upgrade Ubuntu Server or Desktop.
- apt-key(8) — apt — Debian testing — Debian Manpages - Deprecated APT key management utility.
- Solve: Legacy trusted.gpg keyring - ‘apt-key’ Deprecation on Ubuntu - Solve APT key warning on Ubuntu 22.04 or in other latest versions: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
- (Resolved) Key is stored in legacy trusted.gpg Keyring – TecAdmin
- I recently created a new Ubuntu 22.04 LTS Linux virtual machine. When I attempted to set up the PostgreSQL server on it, I saw a warning message like the one shown below on the screen:
- The steps below will help you to move the key to a new location.
- apt - Key is stored in legacy trusted.gpg keyring after Ubuntu 22.04 update - Ask Ubuntu
- Fixing "Key is stored in legacy trusted.gpg keyring" Issue in Ubuntu - There are two ways; the proper way and the quick and dirty way. Read both methods and see which one you feel comfortable with.
- apt-key Is Deprecated. How To Add OpenPGP Repository Signing Keys Without It On Debian, Ubuntu, Linux Mint, Pop!_OS, Etc. - Linux Uprising Blog - This article explains how to securely add OpenPGP keys and third-party APT repositories on Debian, Ubuntu, and Linux distributions based on these, like Linux Mint, Pop!_OS, Elementary OS and so on, to replace the deprecated apt-key.
- List Services, their ports and Reporting
- Use from the CLI
- htop = improved version of top, shows each CPU usage and more.
- top
- ssh - How can I determine which ftp server is running on my ubuntu box - Server Fault
- run this: netstat -tanp
- This article has a few different solutions.
- Ubuntu 20.04 list services - Linux Tutorials - Learn Linux Configuration - In this article you will learn how to list and change state for systemd services and unit files on Ubuntu 20.04 Focal Fossa Linux Server/Desktop.
- Use from the CLI
- What version of Linux am I running?
- Linux version | How to check your Linux version - IONOS - Knowing your Linux version is important when it comes to updates and troubleshooting. We explain how to check your version of Linux.
- How to check your Ubuntu version: a guide - IONOS - You want to find out which Ubuntu version you’re running? We show you three simple ways to check your Ubuntu version.
- Misc
- FTP Servers
- Choosing the Right FTP Server - Linux Power Tools - FTP is an old protocol, and numerous implementations of it have sprung up over the years. These servers vary in many details however, they all serve the same purpose.
- Evaluating FTP Servers: ProFTPd vs PureFTPd vs vsftpd – systemBash
- FTP/SFTP
- How to Set Up SFTP Chroot Jail | Linuxize - If you are a system administrator managing Linux server chances are that you may need to grant SFTP access to some users to upload files to their home directories. In this tutorial we will explain how to setup up a SFTP Chroot Jail environment that will restrict users to their home directories.
- How to Check Which Linux You Are Running? - Logged in on a Linux system via SSH and wondering which Linux distribution is it? Here's how to check the Linux version.
- FTP Servers
- BASH and CLI
- Bash General
- Bash is also a command programming languages like sh.
- Bash is now the default user logon shells on Linux-based operating systems.
- Bash is an extended version of the sh command line interpreter for the GNU alternatives for the Bourne sh shell.
- Bash is not sh
- Bash is a superset of sh. This means bash supports the functions of sh and adds additional functionality.
- What Is Bash? Features, Concepts, Commands And More! // Unstop (formerly Dare2Compete) - What is Bash? A shell & scripting language for UNIX-based systems, developed by Brian Fox under GNU Project. Learn more about Bash script, commands, etc.
- bash(1) - Linux manual page - bash - GNU Bourne-Again SHell
- Bash Reference Manual | GNU.org - Bash Reference Manual
- Adding arguments and options to your Bash scripts | Enable Sysadmin - Exploring methods for getting data into scripts and controlling the script's execution path for better automation and script management.
- Bash Scripts - Part 3 - Command-Line Options and Switches | by Mikhail Raevskiy | Introduction into BASH | Medium - Having mastered the previous parts of this series, you learned about what bash scripts are, how to write them, how to control the flow ofâ¦
- Bash Scripts
- Output to a log file
- linux - Send bash -x output to logfile without interrupting standard output - Server Fault - Is there a way to send the information displayed by running a bash script with the -x option to a file, while not changing the standard output seen by a user running the script?
- linux - How to log output in bash and see it in the terminal at the same time? - Stack Overflow - I have some scripts where I need to see the output and log the result to a file.
- Bash Scripting - Write Output of Bash Command into Log File - GeeksforGeeks - Let see how to write the output of the bash command into a log file.
- Bash script to log the output of the script to a separate log file - Unix & Linux Stack Exchange - Having mastered the previous parts of this series, you learned about what bash scripts are, how to write them, how to control the flow of a program, how to work with files. Today we will talk about how to add interactivity to scripts, equipping them with capabilities to receive data from the user and to process this data.
- Output to a log file
- Differences between Bash and sh, su and 'su -'
- Difference Between sh and Bash in Linux? - Difference Between sh and Bash in Linux - Bash is a BourNeSh (Bourne Again ShEl) which is an improved variant oF thE origiNal Bourne shEll.It is used to run programs in the Bash programming language, and is often referred to as the default shell for Linux distributions. Sh is a simple commandinterpreter for the UNIX System V Release 4.0.
- Difference Between `su` and `su -` Commands in Linux | TecAdmin - This article explains the differences.
- Commands
- Swaps the command line to the root user until session is exited, root temp and stops the need for sudo on every command. Sudo stans for 'Super User Do'.
sudo -s sudo su
- Swaps the command line to the root user until session is exited, root temp and stops the need for sudo on every command. Sudo stans for 'Super User Do'.
- Bash General
- Time commands
- How can I display the current time & date setting? - Ask Ubuntu
# Shows All time and Dates timedatectl ## Show Timezone cat /etc/timezone ## Show Time and Date date # Show Hardware Clock (with high precision) sudo hwclock --show
- How can I display the current time & date setting? - Ask Ubuntu