[Ubuntu] frequently used command and tools

My frequently used command. I don’t want to google them again and again. 🙂


ssh-copy-id username@server_host
ssh-keygen -t ed25519 -C "meow@gmail.com"
ssh-keygen -t rsa -b 4096 -C "meow@gmail.com"
cat ~/.ssh/id_ed25519.pub

cat ~/.ssh/id_rsa.pub


reset file to a commit

git checkout HEAD -- my-file.txt

quick First commit

echo "# project" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:kehanlu/project.git
git push -u origin main

Private fork


Count number of directory

ls . | wc -l


list username for pid

ps -u -p 1234

kill processes by grep search

kill $(ps aux | grep 'meow.py' | awk '{print $2}')

Watch nvidia-smi

  • -n seconds
watch -n 1 nvidia-smi


merge wav files

sox input1.wav input2.wav input3.wav output.wav