A little history:
Battle of Waterloo, and so too the American War of Independence earlier, then the bayonet charge was a battle winner. The Cavalry had its sabres. Green Jackets with their short rifles were issued Sword bayonets because of their short Baker rifles.
American Civil War and bayonets were still useful though rifle firepower was effective further and further out, to the point that getting to bayonet charge range was difficult. Cavalry were using heavy revolvers, multishot, pistols over swords. Big knives were in fashion for all sorts of reasons.
Boar War showed that the bayonet charge was on the way to being suicidal due to actual high volume rifle fire, but the bayonet would persist. The bayonet was getting shorter again for many armies.
The WW1 saw old habits die hard with long bayonets and cavalry still in vogue. The mobile rifle cavalry was still being advocated though those tactics never really happened as a mobile warfare never really got going due to advances in artillery and the heavy machine gun. Trench knives and clubs had their place but the grenade was the weapon for trench fighting.
WW2 saw the end to cavalry at last, as the tank took over; still a lot about though. Bayonets were still part of the bolt action rifle weapon system, though getting shorter and shorter again. The Japs bayoneted a lot of Chinese civilians. The submachinegun, and shortly after the assault rifle, made the bayonet even more redundant. Grenades were the better option for close quarter battle.
There after the short utility bayonet persisted, more for moral and the unreliability of self loading rifles. There were still bolt action rifles used in Korea. The last solid use of the bayonet that I knew of was in the Falklands War. Stuck on the end of the long FN Fal/SLR and the fact that the assaulting troops were running out of ammo in the final assault; the rifle was a 7.62.
Running out of a magazine's ammunition is still a concern due to the very high rates of fire and speed a magazine can be emptied.
With the advent of the bullpup and short carbine assault rifles, and greater reliability, plus effective fire at far greater ranges, then the bayonet has finally in practice become redundant. Well I think so. Their use is still taught more as a aggression teaching aid rather than anything more.
Which just leaves the practical use of a small field knife. Be that fixed or folder, a good knife still has its use. Its just not a weapon system, but a utility tool, and doesn't have to be very big to do that.