how to take output of command in cp linux

C++
cp `ls -SF | grep -v / | head -5` Directory

Source

Also in C++: