- Bash Stuff
- Basic Terminal Shortcuts
- Basic file manipulation
- List all service
- Change folder/file ACCESS group
- Get a list of packages installed locally
- List out only listening connections
- Get rid of persistent update message upon login
- Add, Delete, Modify Users
- To see a list of all users
- Add ssh keys to user
From: http://cli.learncodethehardway.org/bash_cheat_sheet.pdf
CTRL L
= Clear the terminal
CTRL D
= Logout (less, more)
SHIFT Page Up/Down
= Go up/down the terminal
CTRL A
= Cursor to start of line
CTRL E
= Cursor the end of line
CTRL U
= Delete left of the cursor tail = from the bottom
CTRL K
= Delete right of the cursor -n <#oflines>
CTRL W
= Delete word on the left
CTRL Y
= Paste (after CTRL U,K or W) mkdir = create new folder
TAB
= auto completion of file or command mkdir myStuff ..
CTRL R
= reverse search history mkdir myStuff/pictures/ ..
!!
= repeat last command
CTRL Z
= stops the current command (resume with fg in foreground or bg in background)
cat <fileName>
= show content of file
head
= from the top
head -n <#oflines> <fileName>
= from the top #oflines
sudo service --status-all
chgrp www-data filename
dpkg --get-selections | grep -v deinstall
netstat -tnl
From http://www.binarytides.com/linux-netstat-command-examples/
Port Scanner at http://en.dnstools.ch/port-scan.html
From http://ubuntuforums.org/archive/index.php/t-1222909.html
Looks like:
36 packages can be updated.
14 updates are security updates.
sudo apt-get dist-upgrad
sudo reboot
From http://askubuntu.com/questions/410244/a-command-to-list-all-users-and-how-to-add-delete-modify-users
sudo adduser username
sudo deluser username
sudo rm -r /home/username
sudo usermod -1 new_username old_username
sudo passwd username
sudo chsh username
sudo chfn username
sudo usermod -a -G sudo username
sudo cut -d: -f1 /etc/passwd
From https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
- create new user and give sudo permissions [above]
- create .ssh directory in user's home folder as user
- add a authorized_keys file to .ssh/
- copy the public keys into authorized_keys file