136 private links
Map lets you process each line from stdin with a command of your choice. For example:
Note that the command must be wrapped in single quotes to prevent the variable from being expanded by the shell.
There are many ways to accomplish what you can do with map, including find, xargs, awk, and shell for-loops. The approach taken by map is extremely pragmatic and allows me to express concisely what I want. Given the fact that it's designed as a filter, it can operate on any kind of list, not only lists of files.
The problem that prompted me to think about map was the following: given a list of files, I wanted to execute two commands on each. Here's how you can do it with different tools:
This article will teach you how to create and use these five types of aliases:
Simple Aliases
Suffix Aliases
Functions for Aliases With Parameters
Global Aliases
Operating system specific aliases
Easy to use and install.
Multiple cursors.
Common keybindings (Ctrl-s, Ctrl-c, Ctrl-v, Ctrl-z, …).
Sane defaults.
Splits and tabs.
Extremely good mouse support.
Cross-platform (it should work on all the platforms Go runs on).
Plugin system (plugins are written in Lua).
Built-in diff gutter.
Simple autocompletion.
Persistent undo.
Automatic linting and error notifications.
Syntax highlighting for over 130 languages.
Color scheme support.
True color support (set the MICRO_TRUECOLOR environment variable to 1 to enable it).
Copy and paste with the system clipboard.
Small and simple.
Easily configurable.
Macros.
Common editor features such as undo/redo, line numbers, Unicode support, soft wrapping, …
With DB you can very easily save, restore, and archive snapshots of your database from the command line. It supports connecting to different database servers (for example a local development server and a staging or production server) and allows you to load a database dump from one environment into another environment.
For now, this is for MySQL only, but it could be extended to be used with other database systems as well.
Last month, I wrote an article sharing seven Rust-powered command-line utilities.
Those are modern and fast tools you can use every day with your terminal.
Since publishing that original article, I’ve been searching for more Rust-powered command-line utilities, and I discovered more gems that I’m excited to share with you today.
These tools will help you be productive with your terminal work.
This looks like an interesting vim
plugin: it gives you tips, as you type,
on how to improve/shorten the actions you're doing. It's like the Clippy
helper on Windows, but actually useful!
Would your command read well in a poem?
Ah, bitter chill it was!
The owl, for all his awk, was a-cold;
The gunicorn limp’d trembling through the frozen grass,
And silent was the yacc in woolly fold
—Paraphrased from John Keats, The Eve of St. Agnes
Hey it’s just a rule of thumb, but notice how the command AssetCacheTetheratorUtil (added to macOS in 2017) would never fly here.
This is choose, a human-friendly and fast alternative to cut and (sometimes) awk
Features
terse field selection syntax similar to Python's list slices
negative indexing from end of line
optional start/end index
zero-indexed
reverse ranges
slightly faster than cut for sufficiently long inputs, much faster than awk
regular expression field separators using Rust's regex syntax
Rationale
The AWK programming language is designed for text processing and is extremely capable in this endeavor. However, the awk command is not ideal for rapid shell use, with its requisite quoting of a line wrapped in curly braces, even for the simplest of programs:
awk '{print $1}'
Likewise, cut is far from ideal for rapid shell use, because of its confusing syntax. Field separators and ranges are just plain difficult to get right on the first try.
It is for these reasons that I present to you choose. It is not meant to be a drop-in or complete replacement for either of the aforementioned tools, but rather a simple and intuitive tool to reach for when the basics of awk or cut will do, but the overhead of getting them to behave should not be necessary.
This is not a fork. This is a repository of scripts to automatically build Microsoft's vscode repository into freely-licensed binaries with a community-driven default configuration.
Whatfiles is a Linux utility that logs what files another program reads/writes/creates/deletes on your system. It traces any new processes and threads that are created by the targeted process as well.
Rationale:
I've long been frustrated at the lack of a simple utility to see which files a process touches from main() to exit. Whether you don't trust a software vendor or are concerned about malware, it's important to be able to know what a program or installer does to your system. lsof only observes a moment in time and strace is large and somewhat complicated.
In Bash, the history command is capable of much more than what's been covered here, but this is a good start for getting used to using your history instead of just treating it as a reference. Use the history command often, and see how much you can do without having to type commands. You might surprise yourself!
These are great tools and essential to many system administrators' workflows. However, in recent years, the open source community has developed alternative tools that offer additional benefits. Some are just eye candy, but others greatly improve usability, making them a great choice to use on modern systems. These include the following five alternatives to the standard Linux command-line tools.
vgrep is a pager for grep, git-grep, ripgrep and similar grep implementations, and allows for opening the indexed file locations in a user-specified editor such as vim or emacs. vgrep is inspired by the ancient cgvg scripts but extended to perform further operations such as listing statistics of files and directory trees or showing the context lines before and after the matches. vgrep runs on Linux, Windows and Mac OS.
Bach is a Bash testing framework, can be used to test scripts that contain dangerous commands like rm -rf /. No surprises, no pain.
Your terminal can display color, but most diff tools don't make good use of it. By highlighting changes, icdiff can show you the differences between similar files without getting in the way. This is especially helpful for identifying and understanding small changes within existing lines.
Instead of trying to be a diff replacement for all circumstances, the goal of icdiff is to be a tool you can reach for to get a better picture of what changed when it's not immediately obvious from diff.
Ohayou(おはよう), HTTP load generator, inspired by rakyll/hey with tui animation
TIL: which
in Shellscripts sollte vermieden werden. Es ist inkonsistent, unvollständig, nicht plattform-/shellübergreifend und noch nicht mal in POSIX. Stattdessen bietet sich command
an, also z.B. command -v tmux
.
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
In the last two weeks, Peter Zaitsev published a 4-part series on measuring Linux performance on this blog.
His writings cover the 4 main areas where you can spot performance problems on any Linux machine, with practical tips on how to draw the right conclusions. Here are the individual pieces:
Measuring Linux Performance: CPU
Measuring Linux Performance: Disk
Measuring Linux Performance: Memory
Measuring Linux Performance: Network
I found these gave a good overall summary of the things to be on the look-out for whenever you’re troubleshooting slow applications or slow servers.
Ever tried comparing MySQL's my.cnf from a Debian and a Gentoo machine with diff(1) without going crazy?
diff(1) is an awesome tool, you use it (or similar implementations like git diff, svn diff etc) every day when dealing with code. But configuration files aren't code. Indentation often does not matter (yeah, there is diff -w and yeah, people use YAML for configs), order of settings does not matter and comments are just beautiful noise.
How?
cfgdiff will try to parse your configuration files, fetching all the relevant keys and values from them and then pretty-printing them in the original format. These results are then diffed and the diff is shown to you.