This is a quick reference for the most used linux commands by me. I will update this as more command become important. For now this is most web developers need.
This will list all the files in the current directory.
ls ls /path/to/directory/to/list
This will allow you to change directory.
cd /path/to/directory cd .. Go back 1 directory cd ~ Will take you to your home directory
This will allow you to change users. You will have to enter the user’s password if you are not the root. (Super user)
su username Change to the user username su - Change to the user root
This will allow you to change the password of the current user.
passwd passwd username You must be root to specify username
To create a directory.
mkdir dirName This will create the dir in current directory mkdir /path/to/directory
To delete a directory.
rmdir dirName This will create the dir in current directory rmdir /path/to/directory
To create or edit a file using vi.
To change the permissions of the file or folder.
chmod [permissions] [path/to/file/folder] chmod 0777 /home/test
To change the owner of the file or folder.
chown [owner] [path/to/file/folder] chown silvio /home/test
To change the group of the file or folder.
chgrp [group] [path/to/file/folder] chgrp apache /home/test