ffmpeg mp4 cut off from the end

Hello!
I am using Kubuntu, and would like to have an mp4 video shorter (cut off from the end) while keeping the quality of it.
What is a good way of doing it?
I think that ffmpeg can do it... the question is: how?
Thanks a lot,
Tamas