How to merge and trim video using VLC command line

A command line example of merging multiple video:

where in1.mp4 and in2.mp4 are the file to merge, and out.mp4 is the result video.

A command line example of trimming video (time is expressed in seconds):

where in1.mp4 is the file to trim, and out.mp4 is the result video.

Please notice:
Both procedures, once task is finished, require vlc to be closed, otherwise file won’t open correctly.