Tag: Bash
-
Run Remote Commands with SSH and Certificate Authentication on Linux / macOS Terminal
1. Ensure SSH Key-Based Authentication Is Set Up Before proceeding, make sure you have SSH key-based authentication set up between your local machine and the remote server: By default, this creates the keys in ~/.ssh/id_rsa (private key) and ~/.ssh/id_rsa.pub (public key). You can use ssh-copy-id: Or, manually append the public key to the ~/.ssh/authorized_keys file… Read more…
-
Using cURL to Upload and Download Files via the SFTP Protocol
cURL is a powerful command-line tool that enables developers to transfer data between systems using various protocols, including SFTP (Secure File Transfer Protocol). With its flexibility and ease of use, cURL provides an efficient way to upload and download files from SFTP servers without requiring additional software or libraries. This article explores how to leverage… Read more…
-
Batch Compress Image Files into WebP Format with cwebp on Linux
Efficient image compression is vital for web developers and designers striving to optimize website performance. This guide walks you through using cwebp, a Linux-compatible tool, to batch convert JPG, JPEG, and PNG files into WebP format—an image standard known for its superior compression and quality retention. By the end, you’ll have an automated solution to… Read more…
-
Advanced Configuration of Vim Editor: Taking Your Editing Experience to the Next Level
Vim is renowned for its versatility and efficiency as a text editor. While its basic functionalities are often sufficient for everyday tasks, advanced features make Vim a powerful tool for developers, writers, and anyone who works with text. This article explores advanced techniques and configurations that can elevate your Vim editing experience. Customizing Vim with… Read more…
-
Different Use Cases of Bash and EXP (Expect)
What Bash can do, Expect can also achieve; but what Expect can do, Bash may not necessarily be able to accomplish. In system administration and automation tasks, bash and EXP (the command from the Expect tool) are two powerful utilities. While both are used in the command-line environment to execute tasks, they serve distinct purposes… Read more…
-
Using LFTP and Dynamic Variables to Backup Files to a Remote FTP Server
This article provides a simple guide for using LFTP, a powerful command-line FTP client, to automate file backups to a remote FTP server. We will leverage dynamic variables like date and time to create unique backup directories and filenames. What is LFTP? LFTP is a robust command-line tool that supports a wide range of features,… Read more…
-
How to Sort Files by Size in Multilevel Directories in Linux / macOS
Managing files on Linux often involves identifying the largest files within a directory and its subdirectories, particularly when disk space is at a premium. This article explains how to search for files in Linux and sort them by size, with the largest files appearing first. We’ll explore a few efficient command-line methods to achieve this.… Read more…
-
Linux User Management: A Comprehensive Guide
Linux is a multi-user operating system, and user management is a critical aspect of system administration. It involves creating, modifying, and removing users, as well as managing groups, permissions, and access. In this article, we’ll go over several key Linux user management operations, providing examples along the way. 1. Creating a Group In Linux, groups… Read more…