This article mainly and everyone PHP development of Linux commonly used command summary, hope to help everyone.
sudo apt-get install software name (install software command)
sudo nautilus Open file (with root permission)
Su root switches to root
CD directory name (enter directory)
VI File name (edit file)
: Wq (Save exit file)
: Q ( exit )
: q! ( force quit, do not save modified content )
LS (displays all folders and files under the current folder)
Ls-a (show contains hidden files)
mkdir Directory name (create a directory)
RmDir Empty directory name (delete an empty directory)
RM-RF Directory name (delete directory)
-R is recursive down, no matter how many levels of directory, delete
-F is directly forcibly deleted, without any hint of meaning
sudo chmod 0777 directory location (for read and write access)
sudo chmod-r 0777/directory/(Give 777 permissions to all folders or files under folder)
Restart Apache:sudo Service Apache2 restart
Copy folder to another folder: Cp-r/directory/SPACE/new directory/
Restart database: Service MySQL restart
Ubuntu Decompression tarball Command:
Unzip Xxx.zip (unzip)
Zip xx.zip (compressed)
Tar zcvf xxx.zip (compressed)
Tar zxvf xxx.zip (unzip)
MySQL to change root password:
Mysql-uroot-p (requires password, enter password)
Use MySQL;
Update user set Password=password (' admin ') where user= "root";
Flush privileges;
Quit
Service MySQL Restart
Re-entry can be
To view installed software: dpkg--list
Uninstalling programs and configuration files: sudo apt-get--purge Remove program name
Uninstall program only, keep profile: sudo apt-get Remove program name
Ubuntu Reset root password (temporary)
When the SU root password authentication fails
1.sudo passwd (note not password) root
2. Enter the password two times (root new password)
3. Again su root, enter the new password to switch to the root account
When the sudo command is unavailable,/etc/sudoers can be written by anyone because Sudoers's permissions are modified
Workaround: Pkexec chmod 0440/etc/sudoers (to get rid of read and write permissions)
SCP command:
folder to copy files from remote server to Local:
Scp-r root@10.21.21.69: (Your server IP)/var/www/(directory) space/local Directory/
Upload from local to server:
SCP/directory/File root@ip:/directory/
Restart the Server software:
/etc/init.d/+tab key to enter the Restartable directory
Linux Server Import Database file
First enter the database
New Database
Then use the new database name to enter the database
Set the encoding set names UTF8;
Import Database: Mysql>source/directory location where SQL files are stored/xxx.sql;