This article is currently in draft...

This document predominantly references the ubuntu distribution. All examples should work on recent releases of ubuntu (12.04, 14.04 or 16.04).

GRUB Boot Loader

The acronym GRUB is short for Grand Unified Boot Loader

GRUB is for x86-based systems, Das U-BOOT is for embedded systems.

The GRUB2 Configuration file /boot/grub/grub.cfg is generated using the update-grub command based on configuration files in /etc/grub.d/ and the file /etc/default/grub.

To change from a graphical GRUB screen to text-only one, add the following line to your grub configuration. This is sometimes required for compatability when running linux on older ESXi hosts.

# Comment out this line to stop the ubuntu purple splash screen

# Uncomment this line to disable graphical terminal (grub-pc only) 



SystemV, Upstart, systemd, systemctl

init /sbin/init is the first user-level process at system startup. init coordinates the boot process and has it’s origins in older SysVinit distributions.

Modern linux distributions have since replaced SysVinit with one of two new schemes.

  • Upstart was developed by Ubuntu and first appeared in Ubuntu 6.10. It was soon adopted by all the major linux distributions.
  • systemd began life in the Fedora project (2011) and is now standard in RHEL 7, Ubuntu 16.04 and most mainstream distributions use it.

end of GRUB Bootloader section

SysVinit System Runlevels

S,s Same as 1
0 Shutdown system and turn power off
1 Single User Mode
2 Multiple user, no NFS, only text login
3 Multiple user, with NFS and network, only text login
4 Not Used
5 Multiple user, with NFS and network, graphical login with X
6 Reboot

chkconfig command examples

# Get info about a given service
sudo chkconfig SERVICENAME

# List what services start a each runlevel
sudo chkconfig --list 

# Enable service on startup
sudo chkconfig SERVICENAME on

# Disable service from starting
sudo chkconfig SERVICENAME off

# Add a new service to be controlled by chkconfig
sudo chkconfig --add SERVICENAME

chkconfig is part of SysInitV and not used on Ubuntu 16.04, update-rc.d is the equivelent .

update-rc.d command examples

# Enable a service to start on boot
sudo update-rc.d <service> defaults

# Enable service to start on runlevels 3,4,5 priority 20
sudo update-rc.d <service> start 20 3 4 5 

# Enable service to stop on runlevels 0,1,6 priority 80
sudo update-rc.d <service> stop 80 0 1 6 

# Disable service from starting
sudo update-rc.d <service> remove 

service command examples

# Status of all /etc/ini.d/ services
sudo service --status-all

# Start a service 
sudo service SERVICENAME stop

# Stop a service 
sudo service SERVICENAME stop

# Restart a service 
sudo service SERVICENAME restart

# Running status of a service 
sudo service SERVICENAME status


Instead of bash scripts, systemd uses .service files located in /etc/systemd/system/ and cgroups have replaced runlevels. systemctl is used to configure and control services under systemd.

systemctl command examples

Show the status of all services that systemd controls

# or
systemctl list-units -t service --all

Starting, stopping, and controlling services with systemctl

# start a service
sudo systemctl start NAME.service

# stop a service
sudo systemctl stop NAME.service

# stop & start a service
sudo systemctl restart NAME.service

#signal service process to reread config
sudo systemctl reload NAME.service

Restart a service but only if it is currently running

sudo systemctl condrestart NAME.service

Check the status of a service to see if it is running or stopped

systemctl status NAME.service

Set a service to start on boot

sudo systemctl enable NAME.service

Disable a service from starting on boot

sudo systemctl disable NAME.service

Get information about any given service

systemctl show NAME.service

Completely disable a service from startup and being able to run

# disable a service from running and startup
sudo systemctl mask NAME.service

# reenable a disabled service
sudo systemctl unmask NAME.service

end of Statup/Shutdown/Services section

Ubuntu Package Management

w/ aptitude, apt-get, apt-cache, dpkg

Upgrade all packages

sudo apt-get update
sudo apt-get upgrade

Upgrade all packages one-liner

  • refresh package list
  • install package updates w/ no prompt
  • cleanup afterwards
sudo apt-get update; sudo apt-get -y upgrade; sudo apt-get clean

Upgrade linux kernel (linux-generic, linux-headers-generic, linux-image-generic)

sudo apt-get update; sudo apt-get dist-upgrade

Turn on automatic security updates

sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades

Get information about a package

apt-cache show python3

Search available packages by keyword

$ apt-cache search python3

Search available packages matching package name only

apt-cache pkgnames python3

Show package dependencies

apt-cache depends python3

How to find what apt package provides a particular file or binary. This functionality is similar to yum provides on rpm-based distros and requires you install the apt-file package.

# Install apt-file
sudo apt-get install apt-file
sudo apt-file update

# see what package(s) include /usb/bin/python3
sudo apt-file search /usr/bin/python3
# exact string match
sudo apt-file -F search /usr/bin/python3

end of Ubuntu Package Management section

Vim Editor

Install the full version of vim or vim-enhanced

sudo apt-get install vim-nox

end of Vim Editor section

This article is currently in draft...