Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ (head -n 1; tail -n 1) < файл
- $ (head -n 1; wc -l) < файл
- $ (wc -l; head -n 1) < файл
- $ (busybox head -n 1; tail -n 1) < файл
- $ cat файл | (head -n 1; tail -n 1)
- $ (head -n 1; tail -n 1) < <(cat файл)
- $ head --version
- head (GNU coreutils) 8.26
- Copyright (C) 2016 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
- This is free software: you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law.
- Written by David MacKenzie and Jim Meyering.
- $ wc --version
- wc (GNU coreutils) 8.26
- Copyright (C) 2016 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
- This is free software: you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law.
- Written by Paul Rubin and David MacKenzie.
- $ bash --version
- GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
- Copyright (C) 2016 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software; you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law.
- $ cat file
- first line
- second line
- last line
- $ (strace head -n 1; head -n 1) < file
- read(0, "first linensecond linenlast line"..., 8192) = 33
- lseek(0, -22, SEEK_CUR) = 11
- write(1, "first linen", 11) = 11
- $ (truss head -n 1; head -n 1) < file
- read(0, " f i r s t l i n en s".., 4096) = 33
- write(1, " f i r s t l i n en", 11) = 11
- llseek(0, 0xFFFFFFFFFFFFFFEA, SEEK_CUR) = 11
- $ (truss head -n 1 ; head -n 1) < file
- read(0,"first linensecond linenlast li"...,32768) = 33 (0x21)
- write(1,"first linen",11) = 11 (0xb)
- $ cat файл | (head -n 1; head -n 1)
- tee >(head -n1) >(tail -n1) >/dev/null
- $ cat /tmp/file
- head_line
- body
- tail_line
- head_line
- head_line
- tail_line
- head_line
- body
- head_line
Add Comment
Please, Sign In to add comment