I want to export some of the records of a table to a file in Linux.

Is there any command for this?

mysqldump is the command you are looking for.

with it you can create exports in various formats. The standard format gives you a text file with the needed sql statements to recreate the databases from scratch on another system.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.