Egyptian President Anwar Sadat, his voice ringing with bitterness and contempt, denounced Col. Muammar Qaddafi of Libya tonight as a childish and insolent ruler who "thinks he is a second Napoleon."

In a nationally televised speech about the six days of Egyptian-Libyan border fighting that ended Sunday, Sadat said that Qaddafi would "probably learn in time how heads of state are supposed to behave, but that in the meantime he would have to remember that playing with the armed forces is playing with fire."

Sadat reiterated that Egypt has no claim on any Libyan territory and that he has no objection to Qaddafi's internal policies, but he said he would not tolerate any new Libyan attempt to attack Egypt or "undercut this country's interests."

Sadat expressed no regret over the recent flashes in which Egyptian bombers attacked air bases inside Libya and commandos stormed Libyan positions.

He insisted that his hand had been forced by Qaddafi's actions. First, he said, the Libyan leader had sent Yasser Arafat, head of the Palestine Liberation Organization, to Sadat with a complaint that Egypt was enroaching Libyan territory - a charge that Sadat dismissed as an erroneous interpretation of the moving a small amount of leftover World War II barbed wire. Then, Sadat said, Qaddafi sent his troops to attack Egyptian border positions.

"We have no claim on Libyan soil," Sadat said. "The proof is that when our troops went into Libya, they finished their mission and came back. They did not stay there."

He said that Qaddafi's "just a child," and added that the Libyan leader probably learn in time," but that other Arab leaders "cannot tolerate him the way he is."

Speaking from Alexandria University, Sadat lashed out at critics abroad and dissenters at home, defending Egypt and his stewardship of it. He attacked critics who "wear the cloak of Gamal Abdel Nasser," his predecessor as president of Egypt, to portray Egypt as a country beset by political turmoil and economic desperation.

He insisted that Egypt is not "an ailing patient." It is a cultured country with an honorable history, he said, and will "never bow to anyone." He said, "true, we faced certain periods of bitterness and defeat, but our heads were always raised high. We are solving our problems. We are forging ahead on the right path."

While criticizing Qaddafi as one of those who sought to exaggerate Egypt's weaknesses and ignore its strengths, he seemed to be appealing to the Egyptian public for patience in the face of the country's undeniable difficulties. He called on the population to reject "alien elements" who try to foment unrest.

Sadat said that Qaddafi had objected when leaders of the oil sheikhdoms along the Persian Gulf decided to give Egypt $2 billion in economic aid, and demanded that they choose between Sadat and him. This added another to a long list of Egypitan grievances against Qaddafi. These range over every kind of issue from the nature of revolution and socialism to how to deal with the Israelis.

Sadat said, however, "Qaddafi has had his lesson" in the recent fighting, and added, "It is over."

He did not go on to say anything about the possibility of a settlement of the border dispute, or offer anything beyond his unilaterally declared cease fire of Sunday. Libya has not responded officially to that move which was made after the intervention of President Houari Boumediene of Algeria.

While efforts continue to find some way of reducing the tension in the border area, there is no immediate prospect of any negotiations between Egypt and Libya and some observers believe the clashes could resume. Others reject that possibility, saying the Egyptians have eliminated any Libyan capability to wage serious military campaigns in the eastern part of the country.

Aside from his account of the territorial argument - which Sadat described as "clowning" over a strip of land about 50 yards wide - the president revealed little new about the armed clashes or what touched them off. The Libyan forces that first invaded Egyptian territory, he said, were armed with artillery and tanks, as if Qaddafi were "Napoleon coming to conquer Egypt."

The clashes between Egypt and Libya have been following closely throughout the Arab world. Erupting as it did during the U.S. visit of Israeli Prime Minister Menahem Begin and just before a Middle East tour by Secretary of State Cyrus Vance, the border war has prompted speculation about its timing and its possible impact on Arab-Israeli peace negotiations.

Informed observers here tend to agree, however, that the conflict has no hidden meaning, at least on the Egyptian side. The clashes began July 19, when Libyan forces attacked and apparently overran an Egyptian military outpost near the border. The Egyptians, who had been building up their forces in the region for a year in anticipation of such a move, retaliated strongly.

Sources with access to intelligence information say they accept this version of events and there is no evidence to support the theory that the Egyptians provoked the clash or wanted it at this time.

The mystery, they say, is not why the Egyptians bombed and strafed Libyan military installations but why the Libyans attacked in the first place, knowing that they could not stand up to Egypt's superior military might.