Skip to content

Instantly share code, notes, and snippets.

@latpaw
Last active October 31, 2018 11:39
Show Gist options
  • Save latpaw/2ff69e33ae4cc47ad2b2037f5659cebc to your computer and use it in GitHub Desktop.
Save latpaw/2ff69e33ae4cc47ad2b2037f5659cebc to your computer and use it in GitHub Desktop.
some shell
# show all latest commits in each branch
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
# output the designated lines between 3 and 5
sed -n '3,5p' some_file
# or
awk '{if(NR>2&&NR<6) print $0}' some_file
#
grep -C 1 4 some_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment