Skip to content

mtingers/mid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mid

A head and tail CLI tool counterpart -- mid prints the middle of a file (line based).

Usage

mid [-o] [-n number-of-lines] [-] [file1] [file2...]
    -o      print offset (e.g. '@@ line,offset @@')
    -n N    print N lines surrounding midpoint
    -       read from stdin 

Examples

# print 10 lines from the middle of the file
mid file1.txt

# print 20 lines
mid -n 20 file1.txt file2.txt

# use stdin
cat file1.txt | mid -o 

# use stdin and a file by name ('-' required)
cat file1.txt | mid -o - stdin_and_anotherfile_example.txt

About

A head and tail CLI counterpart.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published