9/28/2017 - 7:23 AM

Ubuntu Command

ubuntu command

Ubuntu commands

current kernel uname -r

list currently installed kernels dpkg --list 'linux-image*'

remove old kernels sudo apt autoremove --purge

manually force remove kernel sudo rm /boot/*-0.0.1*

show disk usage df -h

check ubuntu version lsb_release -a

check memory usage free -m

add existing user to group sudo usermod -a -G www-data my_user

Nginx + Codeigniter

change ownership sudo chown -R "$USER":www-data /var/www

change permission sudo chmod -R 0755 /var/www

edit /etc/nginx/sites-available/default

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/myprestasi;
        client_max_body_size 5M;
        index index.php index.html index.htm index.nginx-debian.html;


        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #       # With php7.0-fpm:
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;

        location ~ /\.ht {
                deny all;

soft-link to site-enabled

sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/

Add existing user to group

sudo usermod -a -G www-data dermis

id dermis

groups dermis