Ubuntu Quick Reference

change folder ownership

sudo chown -R $USER /var/www  

Rename folder

mv CodeIgniter-3.1.6/ codeignitor316  

Copy Folder (Please make sure folder path is from root directory and not the relative path)

sudo cp -r /var/www/mediawiki /var/www/mediawiki  

Copy File

sudo cp filename1.py /var/www/filename2.py  

unfiz tar file

tar xzf file.tar.gz  
tar -xf archive.tar.xz

List of installed softwares. Second command will save this list in text file.

apt list --installed  
dpkg --get-selections > list.txt  

Uninstall app

sudo apt remove <app_name>

NGINX start and stop

sudo ln -s /etc/nginx/sites-available/techtrekking.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
# Error log
tail -f /var/log/nginx/error.log

Update local host file

sudo -i gedit /etc/hosts


Upgrade sublime text

sudo apt-get install --only-upgrade sublime-text

Some useful commands

Activity command
sudo service postgresql start
sudo service postgresql stop
sudo service postgresql restart
Update Host file
sudo nano /etc/hosts
sudo reboot

Leave a Reply

Your email address will not be published.