Find First Word of the First Line

How to find first word of the first line of the first ten files?

Showing Answers 1 - 45 of 45 Answers

Ankit Saraf

  • Feb 14th, 2016
 

sed -n 1p FileName | cut -d" " -f1

ARJIT PANDEY

  • Feb 17th, 2016
 

awk -F " " {print$1} filename|head -1

Rakesh Kumar

  • Apr 22nd, 2016
 

head -n 10 filename
it shows 1st 10 files

  Was this answer useful?  Yes

shrey shekhar

  • Apr 26th, 2016
 

sed -n 1p file name--will print the first line of that particular file name

  Was this answer useful?  Yes

Saumyajit Mishra

  • May 15th, 2016
 

head -1 filename | cut -d " "-f1

  Was this answer useful?  Yes

Manvendra

  • Jun 4th, 2016
 

awk {print FNR, $0} filename1 filename 2 ..... filename10 | awk $1 == "1" {print $2} | cut -c1

  Was this answer useful?  Yes

Bala

  • Jul 26th, 2016
 

awk NR>=1&&NR<=10{print $1} filename

  Was this answer useful?  Yes

Raans

  • Sep 6th, 2016
 

for a in `ls -lrt|head -10|awk {print($9)}
do
head -1 $a|awk {print($1)]
done

  Was this answer useful?  Yes

Anupam Kumar

  • Oct 27th, 2016
 

cd test
for i in $(ls -1rt | head -10)
do
awk {print $1} $i
done

  Was this answer useful?  Yes

Pankaj

  • Nov 17th, 2016
 

head -1 | cut -d "" -f1
and in order to print 1 word
head -1 | cut -c1 #where no of lines is 1 that we want to print

  Was this answer useful?  Yes

akhila

  • Jul 7th, 2017
 

sed -n 1 p file | cut -f1 -d

  Was this answer useful?  Yes

firoz khan

  • Aug 27th, 2017
 

Sed -n 1 p file | cut -f1 -d | head -10

  Was this answer useful?  Yes

Asish

  • Dec 22nd, 2017
 

Head -1 *.* | head -10 | ask { print $1} or cut -d -f1

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions