Skip to content

Instantly share code, notes, and snippets.

@timsonner
Last active November 1, 2025 22:15
Show Gist options
  • Select an option

  • Save timsonner/dc1ed03a0c7e92871d91e0de43ef369e to your computer and use it in GitHub Desktop.

Select an option

Save timsonner/dc1ed03a0c7e92871d91e0de43ef369e to your computer and use it in GitHub Desktop.

Bash Bangers

Copy 1st line from file, insert into first line of another file

awk 'NR==1' test.py | xargs -I{} sed -i '1s/.*/{}/' slice.py

Setup Python debugger pdb in file

echo "import pdb; pdb.set_trace()" > test.py

Display specified line of file

sed -n '1p' test.py

Tmux attach to session

# attach to session 0
tmux attach-session -t 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment