Skip to content

Instantly share code, notes, and snippets.

Walter Higgins walterhiggins

Block or report user

Report or block walterhiggins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Do something with all files in a tree.md

I've been using xargs for years without truly understanding what it did. I assumed it repeated the same command on each file but instead it runs the command passing all the files as arguments.

To run a command on multiple files - 1 file at a time - do this:

for file in $DIRECTORY/*; do ${YOUR_COMMAND_HERE} ${file}; done

For example: to revert local changes in a git-managed directory:

View stones.js
(function(exports) {
var bands = [
{
name: "The Beatles",
members: [
{
name: "George Harrison",
instrument: "Lead Guitar",
bio: "Blah blah blah",
songs: ["While my guitar gently weeps", "Here comes the sun"]
View Lakewood-Soccer-Monday-20180212.md
View Lakewood-Soccer-Match-20180211.md
  1. Sean Higgins
  2. Adam Ahern
  3. Brendan Sheehan
  4. Caleb Bourke
  5. Rian McCormack
  6. Jack Murphy
  7. Cian Murphy
  8. Ian Elliot
  9. Sam Metcalfe
  10. Conor Lee
View Lakewood-Soccer-Monday-20180205.md
View Lakewood-Soccer-Monday-20180122.md
  1. Warmup
    • Jumping Jacks x 10
    • Seals x 10 (clap in front)
    • High Knees
    • Lunges
    • Side-shuffle
    • Soldier Kicks
    • Sprints
  2. Clear the goal game https://www.youtube.com/watch?v=-FHm-rz0dr0 2 teams, aim is for each team to score as many goals as possible in 2 minutes.
View Lakewood-Soccer-Monday-20180115.md
You can’t perform that action at this time.