Essential Ubuntu Commands

As you all might already know, I’m a big fan of Ubuntu. I build nearly a hundred web servers each month for my Fiverr gigs and ListingDock services. I use Ubuntu and only Ubuntu for every server I build. Most of my buyers are new to server management stuff. So a recent buyer on ListingDock requested a document with essential Ubuntu commands. So here you go…

You need to login to your VPS as root before you can execute commands on this page. If you don’t know how to login to your VPS, use Login to VPS over SSH tutorial and use the PuTTY method. Filezilla method is to upload and download file from the server. You’ll find both your root password and ip address on the pdf I provide with the delivery. First thing you must do after receiving your delivery is to change the root password of your server. So let’s start with that,

General Server Commands

Change root password

passwd

Reboot Server

reboot

Power off server

poweroff

Navigate to specific Directory

cd /path/to/directory

Delete a file

rm /path/to/file.extension

Delete empty directory

rmdir /path/to/directory

Delete directory with content

rm -rf /path/to/directory

Create an empty directory

mkdir /path/to/directory

Copy a file

cp /path/to/file.extension /new/location

Move a file

mv /path/to/file.extension /new/location

Find a file

locate /path/to/file.extension

Install Something

apt-get install package.name
Virtualmin Commands

Restart Virtualmin

/etc/init.d/webmin restart
Nginx Commands

Restart Nginx

service nginx restart

Stop Nginx

service nginx stop

Start Nginx

service nginx stop

Test Nignx Config

nginx -t

Open config file

nano /etc/nginx/nginx.conf

Open site specific config file

nano /etc/nginx/sites-available/domain.tld
MySQL Commands

Restart MySQL

service mysql restart

Stop MySQL

service mysql stop

Start MySQL

service mysql start

Login to MySQL

mysql -u root -p

Exit MySQL

quit

Reset MySQL Root Password
Create/Delete MySQL Databases
Manage MySQL Databases

This list is noway near to complete. I’m currently having hard time deciding what to include as there are so many. So if you have a command that should be on this page please leave a comment.

Tharindu

Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button