Category Archives: Linux

Find and Remove Files from Shell Prompt in Linux

How do I find and delete files under Linux / UNIX? Remove all error.log files from a folder and its subfolders: find /var/www/ -type f -name "error.log" -exec rm -rf {} \;find /var/www/ -type f -name "error.log" -exec rm -rf {} \; Remove all access.log files from a folder and its subfolders: find /var/www/ -type […]

Update a WordPress Plugin via UNIX Shell Prompt

Need to update a WordPress plugin via UNIX shell prompt? Open the /wp-content/plugins directory, example: cd /var/www/wpsite.com/htdocs/wp-content/pluginscd /var/www/wpsite.com/htdocs/wp-content/plugins Let’s say you need to update WordPress SEO plugin, type: rm -rf wordpress-seo wget https://downloads.wordpress.org/plugin/wordpress-seo.3.9.zip unzip *.zip rm -f *.ziprm -rf wordpress-seo wget https://downloads.wordpress.org/plugin/wordpress-seo.3.9.zip unzip *.zip rm -f *.zip That’s all!

Update WordPress from UNIX Shell Prompt

Need to update WordPress from UNIX shell prompt? Set the current directory to the root folder of WordPress installation: cd /var/www/wpsite.com/htdocs/cd /var/www/wpsite.com/htdocs/ Now type these commands to update WordPress to latest version: rm -rf wp-admin rm -rf wp-includes mv wp-config.php wp-config.bak rm -f *.php mv wp-config.bak wp-config.php wget -O latest.tar.gz https://wordpress.org/latest.tar.gz gunzip latest.tar.gz tar xf […]

Mount a Partition as Read-Only

Mount a partition as read-only: mount -o remount,ro /testmount -o remount,ro /test Verify the mount command has worked: root@server:/# mount -v | grep /test /dev/xvda6 on /test type ext4 (ro,nodev,relatime,data=ordered)root@server:/# mount -v | grep /test /dev/xvda6 on /test type ext4 (ro,nodev,relatime,data=ordered) Mount a partition as read-write: mount -o remount,rw /testmount -o remount,rw /test Verify the […]

List of PHP 7.0 Modules (Apt-Get) Debian 8

Complete list of PHP 7.0 modules available via apt-get: root@server:~# apt-cache search php7.0-* libapache2-mod-php7.0 – server-side, HTML-embedded scripting language (Apache 2 module) libphp7.0-embed – HTML-embedded scripting language (Embedded SAPI library) php-all-dev – package depending on all supported PHP development packages php7.0 – server-side, HTML-embedded scripting language (metapackage) php7.0-apcu – APC User Cache for PHP php7.0-apcu-bc […]

IPv6 addrconf: prefix with wrong length 56

To get rid of these messages in /var/log/syslog: IPv6 addrconf: prefix with wrong length 56 IPv6 addrconf: prefix with wrong length 48 IPv6 addrconf: prefix with wrong length 128 IPv6 addrconf: prefix with wrong length 96IPv6 addrconf: prefix with wrong length 56 IPv6 addrconf: prefix with wrong length 48 IPv6 addrconf: prefix with wrong length […]

Compress files with Tar and show progress and ETA

Run tar command and show progress with ETA: tar cf – /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk ‘{print $1}’) | gzip > big-files.tar.gztar cf – /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk ‘{print $1}’) | gzip > big-files.tar.gz This is the example output: 1.77GB 0:03:02 [8.79MB/s] [============> ] […]

Mount your Dedibox HDD in RescueMode

Start the Dedibox in rescue mode from your Console panel. Then wait 5 minutes before the server is fully loaded in rescue mode. Then try to connect via SSH to the Dedibox IP with the new credentials. Now type “sudo su” and enter your user password (you will become root). Then type “find / -name […]

Find Which Process is Listening upon a Port on Linux

Login via SSH as root and then type: netstat -tulpnnetstat -tulpn Example output: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 438/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 703/exim4 tcp 0 0 0.0.0.0:43331 0.0.0.0:* LISTEN 422/rpc.statd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 411/rpcbind tcp6 0 0 :::22 […]

Default Debian Jessie 8 Repositories (sources.list)

Default content of /etc/apt/sources.list for Debian 8: deb http://security.debian.org/ jessie/updates main deb-src http://security.debian.org/ jessie/updates main   # jessie-updates, previously known as ‘volatile’ deb http://debian.mirrors.ovh.net/debian/ jessie-updates main deb-src http://debian.mirrors.ovh.net/debian/ jessie-updates main   # jessie-backports, previously on backports.debian.org deb http://debian.mirrors.ovh.net/debian/ jessie-backports main deb-src http://debian.mirrors.ovh.net/debian/ jessie-backports main   deb http://debian.mirrors.ovh.net/debian/ jessie main contrib non-free deb-src http://debian.mirrors.ovh.net/debian/ jessie main […]