menu

Syntax - Syntax ubuntu


Untuk menunjang tutorial Ruby on rails yang menggunakan OS Ubuntu maka disini akan saya share beberapa syntax terminal pada Ubuntu beserta cara penggunaannya yang sering digunakan untuk programming.

Structure file
//for go to the folder
cd name_folder

//To user home
cd

//back 1 path folder
cd ..

//show list folder
ls

//show list folder with detail
ll

//show path active
pwd

Operation file
//move or cut file or folder
mv name_file_or_folder

//copy file or folder
cp name_file_or_folder

//remove file
rm name_file

//remove empty folder
rmdir name_folder

//remove folder and contains
rm -rf name_folder

//make folder
mkdir name_folder

//show file content
cat name_file

//change access permissions? read this
chmod

//change owner file or group
chown

//copy file to server or different computer with scp
scp username@IP:path/to/file(source) path/to/destination
or
scp path/to/file(source) username@IP:path/to/destination

Vim
//before inserting code click Esc first

//open file with vim
vim name_file

//save vim
:w

//just quit vim
:q

//save and quit
:wq

//force quit
:q!

Nano
//exit
Ctrl + X

//write or save
Ctrl + O

/find
Ctrl + W

//replace
Ctrl + \

//cut text
Ctrl + K

//get help
Ctrl + G

Apache
//show error log apache
tail -f /var/log/apache2/error.log

Play with Ubuntu
//running with user active
sudo

//install application ubuntu
sudo apt-get install name_application_ubuntu

//update application ubuntu
sudo apt-get update