| | ||
| Capability | Unix and Cygwin | Windows |
|---|---|---|
| Shows the contents of a file cat | file | type file |
| Shows the contents of a file in reverse order (last line first, first line last) | tac file | |
| Shows the contents of a file in reverse order, line by line (line reads right to left instead of left to right) | rev file | |
| Searches for content in a file | grep this file | findstr this file |
| Searches for content in a file that does not match a pattern | grep v this file | |
| Extracts the contents of a file based on delimiter char (such as a TAB-separated file or CSV file) and shows fields n, or n:n | cut d˜ char fn file example: cut -d˜: -f1,2 /etc/passwd | |
| Replaces some content in a file with other content | sed i s/ this / that / file | |
| Shows the first n lines of a file | head n file | |
| Shows the last n lines of a file | tail n file | |
| Shows the last lines of a file, even as new lines are appended | tail f file |
| | ||