delete lines from files
How do i delete first 10 lines from any files , preferble using awk.
|
IMHO, sed would be a better tool for this.
Code:
sed -i '1,10d' file1 file2 file3 |
i tried using this but not working
sed -i '1,10d' alarms.txt sed: illegal option -- i |
Quote:
Code:
awk 'NR>10' file > newfile |
You must not be using the gnu sed program. Sed is lighter weight than gawk,
ls -l /bin/gawk /bin/sed -rwxr-xr-x 1 root root 295432 Sep 21 14:16 /bin/gawk -rwxr-xr-x 1 root root 53056 Sep 21 14:15 /bin/sed Since you don't have the "-i" option, you will need to redirect the output to a temporary file as ghostdog74 mentioned. Code:
for file in file1 file2 file3 file4 Code:
/sbin/lspci -v | sed -n '/Broadcom/,/^$/p' Also, you might consider downloading the source for gawk. It includes the .texi source for the "Gawk: Effective Awk Programming" book, which is excellent. I don't remember the exact make target, maybe "make pdf" or "make doc". You can examine the Makefile yourself to find out. |
|
All times are GMT -5. The time now is 02:27 PM. |