Composer basics

Here a basics list of Composer commands to retrieve the most used one.

Start new php project:

composer init

Install a new packages with:

composer require packageName

Use to find the exact component name

In order to get the latest versions:

composer update

Uninstall packages from composer:

composer remove packageName

Search package from composer:

composer search packageName

Shows a list of installed packages that have updates available:

composer outdated

You should always run the validate command before you commit your composer.json file:

composer validate

less command

The navigation keys in less command are similar to Vim editor.

Forward Search

    / – search for a pattern which will take you to the next occurrence.
    n – for next match in forward
    N – for previous match in backward

Backward Search

    ? – search for a pattern which will take you to the previous occurrence.
    n – for next match in backward direction
    N – for previous match in forward direction

For viewing large log files

    CTRL+F – forward one window
    CTRL+B – backward one window
    CTRL+D – forward half window
    CTRL+U – backward half window
    j – navigate forward by one line
    k – navigate backward by one line
    G – go to the end of file
    g – go to the start of file
    q or ZZ – exit the less pager

Useful other command

    v – using the configured editor edit the current file.
    h – summary of less commands
    &pattern – display only the matching lines, not all.

File paging
You can open multiple files by passing the file names as arguments:

$ less file1 file2