How to find the first field from a file in Bash Shell

0 votes
Hi Team,

I have a huge file on the Linux server. I want to find the first field from that file. How can I do that in Bash shell?
Oct 20, 2020 in Linux Administration by akhtar
• 38,260 points
1,074 views

1 answer to this question.

0 votes

Hi@akhtar,

You can extract text from a file. In Linux, you can find the cut command. In this command, you can pass -f as a field as shown below.

$ cat data.csv | cut -d ',' -f 1
answered Oct 20, 2020 by MD
• 95,460 points

Related Questions In Linux Administration

0 votes
2 answers

how to loop through the content of a file using bash

#!/bin/bash for i in  `cat peptides.txt` do echo $i done READ MORE

answered Sep 5, 2020 in Linux Administration by Prakash K. Aithal
2,981 views
0 votes
1 answer

How to find the group associated with a user in linux?

To list all the groups groups or to list ...READ MORE

answered Jun 21, 2019 in Linux Administration by DareDev
• 6,890 points
939 views
0 votes
0 answers

How to create a file in Linux from terminal window?

What's the easiest way to create a ...READ MORE

Apr 13, 2022 in Linux Administration by Rahul
• 9,680 points
571 views
0 votes
1 answer

Select sections of text from each line of files in a Bash shell.

Hi@akhtar, There is no inbuild command available for ...READ MORE

answered Oct 20, 2020 in Linux Administration by MD
• 95,460 points
1,045 views
0 votes
1 answer
0 votes
1 answer

setting a variable output from a bash command

You can use $(command), which in my ...READ MORE

answered Feb 15, 2019 in Linux Administration by DareDev
• 6,890 points
2,519 views
0 votes
1 answer

How to sort text alphabetically in Linux system?

Hi@akhtar, In the Linux system, you will find ...READ MORE

answered Oct 20, 2020 in Linux Administration by MD
• 95,460 points
26,515 views
0 votes
1 answer

How to check permissions of a file in the Linux system?

Hi@akhtar, If you prefer using the command line, ...READ MORE

answered Aug 13, 2020 in Linux Administration by MD
• 95,460 points
1,745 views
0 votes
1 answer

How to check permissions of a folder in the Linux system?

Hi@akhtar, You can use ls command to check ...READ MORE

answered Aug 13, 2020 in Linux Administration by MD
• 95,460 points
9,756 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP