You can get there by recursively extracting only the first element of each vector in the list and getting the names of that structure:
names(rapply(m, function(x) head(x, 1)))
#[1] "a.b" "a.c" "a.b1"
Here's an example with a more complex input-list:
m <- list(a=list(b=c(1, 2), c=3, b1=list(x=1, y=2:4)), x=list(a=1,b=2), c=4:8)
str(m)
# List of 3
# $ a:List of 3
# ..$ b : num [1:2] 1 2
# ..$ c : num 3
# ..$ b1:List of 2
# .. ..$ x: num 1
# .. ..$ y: int [1:3] 2 3 4
# $ x:List of 2
# ..$ a: num 1
# ..$ b: num 2
# $ c: int [1:5] 4 5 6 7 8
names(rapply(m, function(x) head(x, 1)))
#[1] "a.b" "a.c" "a.b1.x" "a.b1.y" "x.a" "x.b" "c"
For OP's second input, this yields:
p <- list('a' = list('z' = c(1, 2), 'g' = list('i' = 2, 'j' = 3)), 'd' = list('k' = c(4, 5)))
names(rapply(p, function(x) head(x, 1)))
#[1] "a.z" "a.g.i" "a.g.j" "d.k"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…