Tag Linux
Linux commands for WEB developers
Copy a folder
1 |
cp -avr /home/cool_site_folder /var/www/cool_site_new_folder_name |
What port is used?
1 |
netstat -tulpn | grep php-fpm |
Find and delete files greater than a given size
1 |
find . -size +1M -exec rm -i {} \; |
Find out directories using disk space Find a file
1 |
sudo find / -name 'php.ini' |
Sorting ls command output by file size
1 |
ls -Slh |
to reverse order use -r option. Archive directory
1 |
tar -zcvf my-dir.tar.gz /home/user/my-dir |
Copy files from remote to local with Rsync
1 |
rsync -razP user@remote-server.com:~/home/remote-user/file.cpp /home/local-user/ |
…
How to change PHP version in shell
If you have multiple versions of PHP and you want to change PHP version in shell then run the following command:
1 |
whereis php |
This will give you a list of all PHP versions installed:
1 |
php: /usr/bin/php /etc/php.ini /etc/php.d /usr/lib64/php /usr/include/php /usr/share/php |
Find version that you need (i.e. /usr/bin/php71). Then open .bashrc (or .bash_profile) and add the following line to the end of…
Posts about Linux:
- popular commands
- how to install packages
- and more