博文

目前显示的是 三月, 2022的博文

Linux Tips For Beginners

Linux Tips that you regret not knowing earlier... Configure Linux password-less login Add your public key to ~/.ssh/authorized_keys . To get a public key, simply execute the ssh-keygen command, then you'll find your public key and private key in ~/.ssh The public key is used to encrypt your data, and only the corresponding private key can decrypt that data. Save printed text There're two ways to accomplish this. Use the tee command The tee command redirects stdout to a given file as well as print those text to the screen. usage: ls | tee <path/to/output/file> The | symbol is used to redirect the output of the command before it to the command after it. Use the > or >> symbol to redirect output usage: ls > out.txt > overwrites existing file, while >> append new content to existing file. Refresh command every 1 second Let's say you want to refresh the nvidia-smi command every second, you can simply type watch -n 1 nvidia-smi You can also cha