Ollie Reardon

Understanding Ubuntu: Terminal Cheatsheet


22 November 2014

Posted by Ollie Reardon

General Linux commands

cd – Change directory

cd .. – Go Back a directory

cd ../../ – Go back two directories

cp – Copy a file

mv – Move a file

rm – Remove a file

mkdir – Make a directory

rmdir – Remove a directory

man – A built in manual for a specific command

ls – List files and folders

sudo – Executes command with root permissions

sudo su – Login to root user

nano – Easy to use command-line text editor

cat – See the contents of a file

clear – Clear the current terminal display

Ubuntu Specific Commands

sudo apt-get update – Ensures that the repositories have the latest packages available.

sudo apt-get upgrade – Upgrades installed packages

sudo apt-get install – Installs an application and all it’s dependencies packages.

sudo apt-get remove – Removes an application

sudo add-apt-repository – Adds a new Personal Package Archive

sudo apt-get autoremove – Removes any unused dependencies

sudo apt-get do-release-upgrade – Upgrades Ubuntu to a new version

Useful commands for server packages

edit php.ini – sudo nano /etc/php5/apache2/php.ini

edit virtual hosts – sudo nano /etc/apache2/sites_available/new_config

restart apache2 server – sudo service apache2 restart