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  

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
start
sudo service postgresql start
stop
sudo service postgresql stop
restart
sudo service postgresql restart
Update Host file
sudo nano /etc/hosts
Reboot
sudo reboot

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.