DEV Community

Discussion on: What are your CLI go to commands and aliases?

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️ • Edited

For a more compact git history:

git config --global alias.adog log --all --decorate --oneline --graph

git adog

To easily pipe into and out of my clipboard on the terminal:

alias setclip='xclip -selection c'
alias getclip='xclip -selection clipboard -o'

getclip | gpg --sign --armor | setclip

I actually use this a lot to pipe, for example, GPG output directly into the clipboard and then paste it into some GUI application.

pstree -s $$ to show me the path from PID 1 to my current shell. This is really useful when you often start shells from within shells to manage context.

I also have aliases like

alias server='ssh server -t ''tmux a -t home \|\| tmux new-session -s home'''

This way I only have to type server and I get a persistent serssion that lasts until server restart, that I can detatch from easily with Ctrl+D and reattach by just calling server again.

Other than that, I have more than 1k lines in my .vimrc, so I will just leave a link to that instead of telling you about everything it does ;)

Collapse
 
kungtotte profile image
Thomas Landin

I use tmux new-session -A -s session-name. It will create the session if it doesn't exist and reattach if it does exist.