Ayatollah Ruhollah Khomeini's warning against "antirevolutionary forces" today was aimed principally at two guerrilla groups with conflicting ideology but a common goal of continuing Iran's revolution until the last vestiges of "imperialism" are uprooted.

One, the Mujaheddin-e-Khalq, or People's Strugglers consists mainly of Islamic zealots determined to rid Iran of Western influence. The other, the Cherikaye Fedaye Khalq, or People's Sacrifice Guerrillas, is avowedly Marxist and envisions an Iranian breed of socialism.

Despite their clashing views, each clearly wants to avoid a fight with the other at this stage. But each also wants to hold onto its arms.

Hossein Emadi, a Moslem clergyman charged by Khomeini's provisional government to collect their arms, has vowed to dissolve rag-tag bands of "revolutionary soliders" that have formed in Tehran. But he predicted in an interview that the more organized Islamic and Marxist guerrilla groups would end up fighting each other for influence in the new regime.

Khomeini's "Imam Committee," which has close links with the Mujaheddin while fielding its own militia, is eager to crack down on what it views as godless communists.

Nevertheless, the Committee and Khomeini's provisional government are in no position at present to do so, diplomatic sources here say. They are not yet sufficiently organized or powerful enough to suppress the leftists, who acquired formidable arsenals during wholesale looting of military armories last weekend.

Although the Fedaye claim to support the government of Prime Minister Medhi Bazargan, the Marxist guerrilla group really aims to keep puttin obstacles in his path to continue the revolution and eventually bring him down, diplomatic sources say.

These sources say that the attack Feb. 14 on the U.S. Embassy in Tehran was on example on this plan. The Marxist Fedaye gambled correctly that Islamic guerrilla groups, including Khomeini's militiamen, would not crack down on them for the attack since such a move would be tanamount to defending "American imperialism."

Diplomats said more such Fedaye operations can be expected, with the group sure each time that the aim does not conflict with the Islamic revolutionaries' stated goals, but nevertheless continually posing serious problems for Khomeini and Bazargan.

One way to counter this, analysts say, is to isolate the Marxist guerrillas and overwhelm them with numbers, which appears to be the Khomeini Committee's aim in trying to create a "Pople's National Guard."

By pulling together all Islamic groups in a new force to replace the discredited army, Khomeini and company can neutralize the leftists and force them to disarm.

For the time being, a political struggle is under way as the left races against time to try to fuel the revolution, radicalize the population and expand its influence.

In an effort to make their own inroads with a reformed armed forces, the Fedaye have called for establishment of a "Peoples Army" run by political committee in which the Marxists would have a strong voice.

Khomeini Committee hard-liners such as Emadi seem determined not to allow the Fedaye and other Marxist groups such a role.

"It is especially necessary to collect arms from the Fedaye because they are atheists," he said. "We were supposed to reach an agreement with them but since there has not been one, the government will have to collect the weapons by force."

Emadi added, "The Islamic groups will prevail because the people are with them. The Fedaye have no place among the public. They do not have any popular base."

Regardless, the campus of Tehran University, where Emadi has his headquarters, seems to be a leftist stronghold. Many of the students lean more toward Marx than Mohammed. Persian language copies of "Das Kapital" and other communist works sell freely at sidewalk displays all over the university grounds, along with posters of Lenin and Che Guevara.

Although Emadi is slowly disbanding the armed guards who surround his mosque headquarters, a Chieftain tank mounted with a machine gun sits outside, manned by a gunner.

In a separate interview on the campus, a clandestine Fedaye leader vowed not to turn in weapons "so long as imperialism is not annihilated in our country."

He said "imperialism" continued to be represented by Western 'economic and cultural institutions" and by the Iranian Army, bureaucracy and rem nants of the police force.

The short, stocky leader declined to give any personal details as he spoke through an interpreter at the university's Fedayeheld Technical Sciences.

He said the group has "military" relationships with the Marxist oriented Popular Front for the Liberation of Palestine and the South Yemenbacked rebels who fought the shah's forces in Oman's Dhofar Province in the early 70s.

The Fedaye leader had harsh words for Iran's Tudeh Communist Party, which he said did not participate in the armed struggle against the shah. He accused the Tudeh of blindly following the Soviet line and rejected dependence on any other country, whether Western or Eastern.

He said the Fedaye had no "special relationship" with either the Mujaheddin or its Marxist offshoot, Paykar, on Struggle.

To defuse tension at the university, the two main groups are moving to former government buildings on opposite sides of the university. The Mujaheddin have taken over the former Imperial Inspectorate building on Eisenhower Street, and the Fedaye occupied a building belonging to the disbanded secret police, SAVAK, on Queen Elizabeth Boulevard to the northeast.

Fearing each other at least as much as any purported "imperialist" plot against Iran, the two groups are not about to turn in their guns. Neither are the half-dozen other recently formed Islamic guerrilla groups and the few Marxist splinter outfits.

The existence of one of the latter was casually announced by a former Fedaye fighter in a chat at the university. He said he had just formed a group called "Red Soil" and had recruited 60 members.