Ubuntu

  • uptime : check time use on computer

remove app

  • sudo apt-get purge
  • sudo apt autoremove

switch to gui mode

  • Ctrl + Alt + F7

check port used

sudo lsof -t -i:80

stop process by port

sudo kill `sudo lsof -t -i:80`

check disk free

df -h

add user

  • adduser
adduser dukerspace

add root privileges

  • visudo
user ALL=(ALL:ALL)ALL

remove user

  • userdel
userdel dukerspace

set timezone

sudo timedatectl set-timezone Asia/Bangkok

check timezone

timedatectl
timedatectl status | grep "Time zone"

Password using SSH

  • Find path
/etc/ssh/sshd_config
  • Look for the line which reads:
PasswordAuthentication no

and change it to

PasswordAuthentication yes

Save the file.

sudo passwd $USER

tree

tree

tree media

app

  • tmux
  • htop

login as root

sudo -i

change user

sudo -u -s

sudo -u ubuntu -s

find file


https://www.plesk.com/blog/various/find-files-in-linux-via-command-line/

find large file

sudo du -a / 2>/dev/root | sort -n -r | head -n 20

harddisk used

df -h

ram used

free -h

add user

sudo adduser runner
sudo usermod -aG sudo runner
su - runner

remove user

sudo deluser username