First Two Lines
Tagged with: command, head, line, Linux, tail
Sunday, April 13th, 2008 10:17 PM
View first two lines of a file
head -2 file
tail -2 file # for last 2 lines
View first two lines of a file
head -2 file
tail -2 file # for last 2 lines
Create a command that will return the pid of the given command string..
#!/bin/sh
ps aux|grep $1|head -n1|awk '{print $2}'