Tech Notes, Linux Bash

Just my Linux Bash notes…

Rename Ubuntu System

  1. nano /etc/hostname
  2. (Replace the current computer name with the desired new name. Save.)
  3. nano /etc/hosts
  4. (Change the system name on the 127.0.0.1 line. Save.)
  5. Restart

List All Subdirectories (based on cwd) and Disk Size

du -ks $(ls -d */) | sort -nr | cut -f2 | xargs -d ‘\n’ du -sh 2> /dev/null

Mount SMB Share at Boot

mkdir /mnt/Share
nano /etc/fstab
(Add to end…)
//192.168.0.4/Share /mnt/Share cifs username=User,password=Pass 0 0

Reload fstab without Reboot

mount -av

LAMP Setup

  1. apt-get install tasksel
  2. tasksel install lamp-server
  3. Update MySQL root user auth to make secure tool work
    1. mysql
    2. ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;
    3. exit
  4. mysql_secure_installation (don’t edit the root user password)
  5. Undo MySQL root user auth change
    1. mysql -u root -p
    2. ALTER USER ‘root’@’localhost’ IDENTIFIED WITH auth_socket;
    3. exit
Tech Notes, Linux Bash
Scroll to top