NOTE: MORE ITEMS WILL BE ADDED TO THIS LIST
Today I decided to keep a Linux cheat sheet around to avoid looking up some common tasks on Google. I keep forgetting some commands and I feel like I should get them tattooed somewhere on the back of my hand so that I wouldn’t forget them. Although this list is currently very short, I will keep adding new stuff to it.
Program Specific:
Git:
git submodule update --remote --merge
Screen:
screen -S [SESSION NAME]
Ctrl + A ; :sessionname [NEW SESSION NAME]
screen -ls
Attach to a session
screen -r [SESSION NAME]
Detach from window:
Ctrl + A ; D
Exit screen:
Ctrl + A ; \
nvidia-xconfig:
sudo nvidia-xconfig --enable-all-gpus
sudo nvidia-xconfig --cool-bits=28
Fail2ban:
fail2ban-client set [JAIL NAME] unbanip [IP ADDRESS]
Script Related:
- Put the script/command in
/etc/rc.local
- Put the script/command in
/etc/crontab
with@reboot [USERNAME] [COMMAND]
[PROGRAM] |& tee output.txt
Commands:
File and Directory Management:
ln -s [TARGET] [LINK NAME]
cd -
rsync -az --progress [USERNAME]@[REMOTE HOST]:[REMOTE PATH] [LOCAL PATH]
Searching:
find [START PATH] -name [NAME OF FILE]
Find a directory:
find [START PATH] -type d -name [NAME OF DIRECTORY]
grep -Ril "[TEXT TO FIND]" [START PATH]
User Management:
groups
Add user to the list of sudoers:
sudo adduser [USERNAME] sudo
Run program as another user:
su [USERNAME] -c "[COMMAND TO RUN]"
Recent Comments