How to use `ls` to group and show only a first word of directory name?

I intend to specify a new ls command to do something similar to this

The first when i usage average ls command:

$ls
undergrade.AI              undergrade.KDD
undergrade.AI2             undergrade.micro
undergrade.ANN             undergrade.OOT
undergrade.autoMata        undergrade.OS
undergrade.bulletin        undergrade.parallelAndDistributedProgramming
undergrade.CG              undergrade.pop
undergrade.CLP             undergrade.PPL
undergrade.comNet          undergrade.researchingMethod
undergrade.comOr           undergrade.SA
undergrade.comSec          undergrade.SE
undergrade.DBMS            undergrade.softwareTesting
undergrade.discrete        undergrade.webApps
code.ajax  code.cc  code.erl  code.html    code.js    code.pl     code.py   
code.sage  code.x3d code.c    code.cl      code.go    code.jquery code.lisp  
code.pro   code.roo code.sh   code.xml

And for a new ls that i want:

$ls_new
undergrade  code

I desire it to show just the first word when i type ls_new.

Why do i desire this command?

Due to the fact that i called my folders in pattern of category.subj that so way too much result when i usage average ls. after that i require some command that can filter, team and also show them yet just the category name.

2
2022-07-25 20:46:40
Source Share
Answers: 0