Blog

Page 508 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for How can I format my grep output to show line numbers at the end of the line, and also the hit count?

How can I format my grep output to show line numbers at the end of the line, and also the hit count?

Published on September 2, 2023

# Formatting grep Output with Line Numbers and Hit Count: A Complete Guide If you're a regular user of the `grep` command, you might have come across the need to format the output to show line numbers and the hit count. This can be particularly useful whe

Cover Image for How to terminate a python subprocess launched with shell=True
pythonsubprocess

How to terminate a python subprocess launched with shell=True

Published on September 2, 2023

# How to Terminate a Python Subprocess Launched with shell=True So, you're trying to terminate a Python subprocess that was launched with `shell=True`, but it keeps running in the background even when you try to use `p.terminate()` or `p.kill()`. Don't wo

Cover Image for How to limit depth for recursive file list?

How to limit depth for recursive file list?

Published on September 2, 2023

šŸ“ **Limiting Depth for Recursive File List in Linux** šŸ¤” Have you ever found yourself needing to get a file listing in Linux but only interested in the ownership and permissions information for the first level subdirectories? šŸ“‚ šŸ” Fear not! We've got a

Cover Image for sed command with -i option failing on Mac, but works on Linux
macos

sed command with -i option failing on Mac, but works on Linux

Published on September 2, 2023

# Command Line Magic: Fixing the `sed -i` Command on Mac šŸ§™ā€ā™€ļøšŸ’» So you've been using the powerful `sed` command on Linux to search and replace text, but when you tried it on your Mac, it blew up in your face? Fear not, my fellow tech sorcerer! We are abo

Cover Image for How can I run dos2unix on an entire directory?

How can I run dos2unix on an entire directory?

Published on September 2, 2023

šŸ‘‹ Welcome to my tech blog! Today, I'll show you how to run dos2unix on an entire directory. šŸ“‚ So you've found yourself in a situation where you need to convert an entire directory using dos2unix, but you're not quite sure how to go about it. Don't worry

Cover Image for How do I escape spaces in path for scp copy in Linux?
whitespace

How do I escape spaces in path for scp copy in Linux?

Published on September 2, 2023

šŸ“ **How to Escape Spaces in Path for SCP Copy in Linux?** Have you ever encountered the frustrating "No such file or directory" error message while using the `scp` command in Linux? Fear not, as we have the solution to this common problem. Let's dive in

Cover Image for How to pass password to scp?

How to pass password to scp?

Published on September 2, 2023

# How to Pass Password to SCP? šŸ˜®šŸ”‘ Do you find yourself in a situation where you need to copy files via `scp` in a batch job, but the receiving server does not support key-based authentication and requires a password šŸ¤”? Although it is not recommended du

Cover Image for Extract file basename without path and extension in bash
filenames

Extract file basename without path and extension in bash

Published on September 2, 2023

# Extracting File Basename without Path and Extension in Bash So you have some file names with paths and extensions, and you just want to extract the base name of the file without the path and extension, right? Well, you've come to the right place! In thi

Cover Image for Using awk to print all columns from the nth to the last
cygwinshell

Using awk to print all columns from the nth to the last

Published on September 2, 2023

# šŸ’» Unleashing the Power of Awk: Printing Columns Like a Pro! šŸ’Ŗ Are you tired of struggling with extracting columns from your data using awk and getting stuck with whitespace issues? šŸ¤” Say no more! In this post, I'll show you a simple yet powerful way

Cover Image for Get program execution time in the shell
shell

Get program execution time in the shell

Published on September 2, 2023

# Get program execution time in the shell šŸš€ā±ļø Are you looking for a quick and easy way to measure program execution time in your Linux shell? Look no further! In this blog post, we'll dive into the problem of timing program execution in the shell, explor