Skip to content

Instantly share code, notes, and snippets.

@timsonner
Last active March 7, 2026 20:49
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.
Miscellaneous bash commands

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

Fix app icons

update-desktop-database ~/.local/share/applications && gtk-update-icon-cache -f -t ~/.local/share/icons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment