unlink mySymLink
Tag Archives: Command
Linux Set Time From Shell
You can set the time by using the following command.
date -s "06 DEC 2017 10:00:00"
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
Verify PHP-FPM service is running
Run the following command to see if php-fpm is running
netstat -pl | grep php-fpm.sock
mysql import dump tar.gz file
Run the following command
gunzip < [backupfile.sql.gz] | mysql -u[username] -p[password] [database]
escapeshellcmd
escapeshellcmd() escapes any characters in a string that might be used to trick a shell command into executing arbitrary commands. This function should be used to make sure that any data coming from user input is escaped before this data is passed to the exec() or system() functions, or to the backtick operator.
Following characters are preceded by a backslash: &#;`|*?~<>^()[]{}$\, \x0A and \xFF. ‘ and ” are escaped only if they are not paired. In Windows, all these characters plus % and ! are replaced by a space instead.
<?php $command = './configure '.$_POST['configure_options']; $escaped_command = escapeshellcmd($command); system($escaped_command); ?>
Create product programmatically Magento 2
In this tutorial I will explain how to create product from CLI.
Declare the module
File: app/code/PHPCodez/Product/etc/module.xml Continue reading Create product programmatically Magento 2
Magento 2 Create Customers Using CLI
Here I am creating a module PHPCodez_Customers that will help us to create customers from commandline.
Create folders for the modul app/code/PHPCodez/Customers Continue reading Magento 2 Create Customers Using CLI
Add New Command Magento 2
Follow the below steps to create new command line in to Console CLI in Magento 2.
Define command in di.xml
In di.xml file, you can use a type with name Magento\Framework\Console\CommandList to define the command option. Continue reading Add New Command Magento 2
Compress Files Linux TAR
tar -czvf name-of-archive.tar.gz name-of-the-file-to-be-compressed
-c: Create an archive.
-z: Compress the archive with gzip.
-v: Display progress in the terminal while creating the archive(verbose mode).
-f: Allowsto specify the filename of the archive.