find . | wc -l
Tag Archives: Linux
create temporary alias linux
$ alias wr=”cd /var/www/html”
globbing
File globbing is a feature provided by the UNIX/Linux shell to represent multiple filenames by using special characters called wildcards with a single file name. A wildcard is essentially a symbol which may be used to substitute for one or more characters. Therefore, we can use wildcards for generating the appropriate combination of file names as per our requirement.
The bash shell provides three characters to use as wildcards:
- Asterisk (*) to represent 0 or more characters
- Question mark (?) to represent exactly one character
- Square brackets ([]) to represent and match for the character enclosed within the square brackets.
Linux Set Time From Shell
You can set the time by using the following command.
date -s "06 DEC 2017 10:00:00"
Delete First N Lines Large File Linux
Run the following command
sed -i '1,200d' file_name.sql
List File Size In GB Linux
Use –block-size=M /G
For example ls -lrt --block-size=GB
will list the files with size info in GB
Magento 2 Session Factory Does Not Exist
Issue the following command to fix the issue.
php bin/magento setup:static-content:deploy -f php bin/magento setup:di:compile php bin/magento indexer:reindex php bin/magento cache:flush
Magento 2 Default Nginx Configuration
upstream fastcgi_backend {
server unix:/var/run/php-fpm/php-fpm.sock;
}
server {
listen 80;
server_name www.phpcodez.com phpcodez.com;
set $MAGE_ROOT /usr/share/nginx/html/phpcodez;
include /usr/share/nginx/html/phpcodez/nginx.conf.sample;
}
Verify PHP-FPM service is running
Run the following command to see if php-fpm is running
netstat -pl | grep php-fpm.sock
Default Nginx Configuration
server { listen 80; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }