Aetles + bash   9

My Favorite Command-Line Shortcuts | Henrik Warne's blog
Most people I have worked with use both arrow-up and ctrl-r when repeating commands. However, very few are familiar with escape-dot and repeating commands from the history list. Since I use all four ways very frequently, I thought I would write a post to spread the word.
bash  unix  terminal  osx  macos  tips  mactips 
august 2018 by Aetles
Handy Bash feature: Process Substitution — Medium
Ooooh, what was that weird syntax? And why did it appear to run twice as fast as what I was expecting?

Process substitution!

Process substitution gives you similar capabilities to piping. Except piping only allows you to pipe the output from a single command into another. In the diff scenario, we need to pipe the output from multiple commands into another. And that’s what process substitution allows us to do.

The syntax for using process substitution is this:

$ some-command <(another-command)
bash  tips  unix  terminal 
june 2015 by Aetles - match command-line arguments to their help text
write down a command-line to see the help text that matches each argument
bash  commandline  terminal  osx  development 
january 2015 by Aetles
BashPitfalls - Greg's Wiki
This page shows common errors that Bash programmers make.
bash  linux  programming  tips 
october 2014 by Aetles · The Terminal
I’ve been using the Unix command line since 1983 and like most software developers, the Terminal app is a permanent fixture in my Dock. Over the years I’ve learned a lot of things that make working in this environment more productive, but even old dogs like me are constantly learning new tricks.

As much as I love them, these long “trick lists” on Stack Overflow have a problem: they’re poorly organized with little narrative describing why you’d want to use a technique. This long homage to the command line is my attempt to remedy that situation.
terminal  tips  osx  mactips  bash 
september 2014 by Aetles (λ) - Keeping bash history in sync on disk and between multiple terminals
PROMPT_COMMAND lets you specify a command that bash will run every time it shows you a fresh command prompt, i.e. every time you run a command and the command finishes. So the above tells bash to read any new lines that have appeared in ~/.bash_history since the last time it read it, and then append the last-run command from this terminal to ~/.bash_history, every time you run a command.

So now, if you type a command in one terminal, and want to access it via the history of another terminal, run a command in the other terminal (or just hit Enter) to trigger PROMPT_COMMAND, and then your history will be nicely up-to-date and synchronized with any other terminals you have open. Almost certainly, you'll never notice the tiny bit of overhead caused by bash constantly reading and writing to ~/.bash_history.

See man bash for more info on the history builtin.
bash  history  linux  tips 
march 2012 by Aetles
Linux Command Line tips that every Linux user should know.
Below is the collection of Linux command line tips which I’ve found useful for Linux users. To get more information about the command mentioned below just open your terminal and type man <command>.
bash  command  linux  terminal 
february 2012 by Aetles
Typing less in Drush: aliases and autocompletion | Nuvole
How to work more efficiently with some Drush-Bash tricks
While Drush is a big time saver, the textbook version of some commands can become lenghty at times:

$ drush pm-enable faceted_search
$ drush features-revert nuvole_news
An out-of-the-box Bash completion for Drush is in the works, and the Drush shell ("drush core-cli") already offers fast access to commands and fancy features. However, if you prefer not to leave your shell and use a stock Drush, here are some tips for a faster Drush experience involving aliases and autocompletion.
drupal  drush  bash 
november 2010 by Aetles
[PLUG] untar multiple files
> Does anyone know of an easy way to untar/zip multiple files at once? I
> figure a script is probably the best solution but unfortunately my
> scripting skills are about non-existent at this point.

Learn for loops:

bash$ for i in *.tar.gz; do tar -xvzf $i; done
bash  tar 
august 2010 by Aetles

Copy this bookmark: