Unless you’re asking about carrying a knife in specific areas that are prohibited (schools, courthouses, some governmental offices, etc.), the two laws you need to know are Penal Code sections 12020 and 653k.
Penal Code section 12020(a) 21310 (that is the new code section) makes it a felony to carry a “dirk or dagger” concealed on your person. A knife, no matter how big and ugly, carried on a sheath on your belt (if not covered by a jacket or shirt) is not concealed and is not against the law. A “dirk or dagger” is an object with or without a handguard that is readily capable for immediate use as a stabbing instrument. It does not have to be a knife. Sharpened screwdrivers and other tools can qualify as well. A folding knife, carried folded in your pocket does not qualify as a concealed dirk, since when it’s folded, it’s not “readily available” for use as a stabbing instrument.
The types of knives that are illegal to carry are covered in Penal Code section 653k 21510 (that is the newly renumbered section). That makes it illegal to carry on your person or in the passenger compartment of a car any switchblade or similar knife. It also includes butterfly knives, gravity knives or other knives that can be opened with the push of a button, a flick of the wrist or gravity. It is a misdemeanor to carry one of these knives.
(One word of caution in Los Angeles County: There are specific county ordinance that covers knives. See the link here for the section. That law defines “knives and daggers” as “any knife having a blade of three inches or more in length; any spring-blade, switch-blade or snap-blade knife; any knife any blade of which is automatically released by a spring mechanism or other mechanical device; any ice pick or similar sharp stabbing tool; any straight-edge razor or any razor blade fitted to a handle.” Section 13.62.020 makes it unlawful for any person to carry a knife or dagger [as defined in 13.62.010] in plain view.
If you look at the state laws (Penal Codes 21310 and 21310), you could (in theory) carry a machete since it’s not a “dirk or dagger” or prohibited by 21310. That same machete (basically a very long bladed knife), if carried in plain view in Los Angeles County, would be a violation. A folding pocket knife, if carried in the pocket is not in plain view and appears not to be covered by these County ordinances.)
Those are the definitions and the main laws covering knives in California, but if you are arrested or charged with carrying a knife, there are several issues you and your attorney should explore, including whether or not the knife fits the legal definition of a prohibited weapon, whether the search was legal and if the arrest was proper.