jadelennox: Demonic Tutor, Jadelennox: my Magic card (demonic tutor)
[personal profile] jadelennox posting in [community profile] command_liners
So a fun shell trick (works in bash, tcsh, zsh) involves curly brace expansion. Different shells have different complexities, but the simplest case that works in all shells is

mv movies-19{92,93}.txt

which expands

mv movies-1992.txt movies-1993.txt

I use this daily. Usually to say mv foo.sh{,.bak} which translates to mv foo.sh foo.sh.bak

Date: 2013-06-03 03:58 pm (UTC)
troisroyaumes: Painting of a duck, with the hanzi for "summer" in the top left (Default)
From: [personal profile] troisroyaumes
Wow, why didn't I know this before? Thank you, that is such a timesaver.

Profile

command_liners: A command line prompt with a blinking cursor after it, green against black. (Default)
Command Liners

January 2022

S M T W T F S
      1
2 345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 10th, 2025 08:48 pm
Powered by Dreamwidth Studios