← 返回命令列表

Linux command

magento 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List available commands

magento list

Enable maintenance mode

magento maintenance:enable

Disable maintenance mode

magento maintenance:disable

Clear cache

magento cache:clean

Flush cache

magento cache:flush

Reindex all

magento indexer:reindex

Compile dependency injection

magento setup:di:compile

Deploy static content

magento setup:static-content:deploy

说明

magento is the command-line interface for Magento/Adobe Commerce e-commerce platform. It manages store operations, deployments, and maintenance tasks. Cache management is critical for performance. Clean removes specific cached data while flush clears all storage. Different cache types (config, layout, block_html, collections, etc.) can be targeted individually. The deployment process involves dependency injection compilation, static content deployment, and database upgrades. These steps are required after code changes or module installations. Indexers keep derived data synchronized with source data. Reindexing is needed after catalog changes, price updates, or inventory modifications. Maintenance mode shows a service unavailable page to customers while allowing administrators to work. IP exceptions can be configured.

参数

cache:clean
Clean cache types.
cache:flush
Flush cache storage.
cache:status
Show cache status.
cache:enable _TYPE_
Enable cache types.
cache:disable _TYPE_
Disable cache types.
indexer:reindex
Reindex all indexers.
indexer:status
Show indexer status.
maintenance:enable
Enable maintenance mode.
maintenance:disable
Disable maintenance mode.
setup:upgrade
Upgrade database schema.
setup:di:compile
Compile dependency injection.
setup:static-content:deploy
Deploy static view files.
module:enable _MODULE_
Enable module.
module:disable _MODULE_
Disable module.
deploy:mode:set _MODE_
Set application mode (developer, production).

FAQ

What is the magento command used for?

magento is the command-line interface for Magento/Adobe Commerce e-commerce platform. It manages store operations, deployments, and maintenance tasks. Cache management is critical for performance. Clean removes specific cached data while flush clears all storage. Different cache types (config, layout, block_html, collections, etc.) can be targeted individually. The deployment process involves dependency injection compilation, static content deployment, and database upgrades. These steps are required after code changes or module installations. Indexers keep derived data synchronized with source data. Reindexing is needed after catalog changes, price updates, or inventory modifications. Maintenance mode shows a service unavailable page to customers while allowing administrators to work. IP exceptions can be configured.

How do I run a basic magento example?

Run `magento list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does cache:clean do in magento?

Clean cache types.