What happens when you use the individual characters in 姓氏 and 名字? 姓氏 refers to surname, and 名字 refers to personal name.
But I’ve heard people using the separate characters to talk about surnames and personal names.
For example:

我的中文老师姓姚
林氏集团 (Lin’s Corporation, like one of those companies named after their founder)
她名叫小丽
字: I’m not too sure about this one, but I know 李白’s 字 is 太白

What is the difference between all these?
From my answer to this question What does this symbol mean? I explained 姓氏 It may be a good reference to your question

From my answer to this question Why is there such a difference between &quot;first name&quot; and &quot;last name&quot;? I explained 姓 and 名字


  In the past, most people in high society would have a 姓(family name), a 名 (given name) and a 字 (Courtesy name)


Example of using individual characters in 姓氏 and 名字:


他姓曹 = his last name is 曹
曹氏一族 = the clan of 曹 family
他姓曹，名操，字孟德 = his last name is 曹, first name is 操 and his courtesy name is 孟德