Cationic modification of cotton fabric was an effective way to improve the inkjet printing performance with reactive dye ink. However, there were few research studies that focused on the effect of the cationic agent structure, especially the alkyl chain length of the quaternary ammonium salt (QAS) cationic modifier, on the K/S value, dye fixation, and diffusion of inkjet-printed cotton fabric. In our work, different alkyl chain lengths of QAS were synthesized, and the inkjet printing performance of cationic cotton fabrics treated with different QASs was investigated. Compared with untreated cotton fabric, the K/S value and dye fixation of cationic cotton fabric treated with different QASs improved by 10.7 to 69.3% and 16.9 to 27.7%, respectively. With the increase in alkyl chain length of QAS, the interaction force between anionic reactive dyes and cationic QAS gradually increased mainly due to the fact that more N-positive ions on the quaternary ammonium group were exposed under the action of steric hindrance of alkyl chain length through the XPS spectrum. The electrostatic attraction between cationic cotton and reactive dye contributed to the diffusion of reactive dye into the fiber interior and enhanced the reaction probability of nucleophilic substitution reaction between monochlorotriazine reactive dye and the hydroxyl group of cotton fabric. The antibacterial result of the inkjet-printed cotton fabric indicated that when the alkyl chain length of QAS was higher than 8, the cationic cotton fabric obtained good antibacterial property.