Linux commands: Difference between revisions

Jump to navigation Jump to search
60 bytes added ,  24 November 2017
m
Line 20: Line 20:
Display the content of text file
Display the content of text file
* [http://en.wikipedia.org/wiki/Vi vi] <nowiki>[options]</nowiki> ''filename''  ({{Linux}})
* [http://en.wikipedia.org/wiki/Vi vi] <nowiki>[options]</nowiki> ''filename''  ({{Linux}})
* {{kbd | key=cat ''filename''}}  ({{Linux}})
* {{kbd | key=<nowiki>cat <filename></nowiki>}}  ({{Linux}})
* {{kbd | key=type ''filename''}}  ({{Win}})
* {{kbd | key=<nowiki>type <filename></nowiki>}}  ({{Win}})
* [http://unix.stackexchange.com/questions/47407/cat-line-x-to-line-y-on-a-huge-file tail - cat line X to line Y on a huge file - Unix & Linux Stack Exchange]
* [http://unix.stackexchange.com/questions/47407/cat-line-x-to-line-y-on-a-huge-file tail - cat line X to line Y on a huge file - Unix & Linux Stack Exchange]


Display the partial content of large text file
Display the partial content of large text file
* {{kbd | key=cat ''filename'' | less}}  ({{Linux}}) {{exclaim}} Chinese issue<ref>[https://stackoverflow.com/questions/6943928/show-special-characters-in-unix-while-using-less-command linux - Show special characters in Unix while using 'less' Command - Stack Overflow] ''un-verified''</ref>
* {{kbd | key=<nowiki>cat <filename> | less</nowiki>}}  ({{Linux}}) {{exclaim}} Chinese issue<ref>[https://stackoverflow.com/questions/6943928/show-special-characters-in-unix-while-using-less-command linux - Show special characters in Unix while using 'less' Command - Stack Overflow] ''un-verified''</ref>
* {{kbd | key=type ''filename'' | more}}  ({{Win}}) If the file was encoded in UTF-8, you need to key in {{kbd | key=chcp 65001}} first <ref>[http://fatting10.blogspot.tw/2015/08/solved-window.html [Solved] Window命令視窗中文亂碼 改編碼方法]</ref>.
* {{kbd | key=<nowiki>type <filename> | more</nowiki>}}  ({{Win}}) If the file was encoded in UTF-8, you need to key in {{kbd | key=chcp 65001}} first <ref>[http://fatting10.blogspot.tw/2015/08/solved-window.html [Solved] Window命令視窗中文亂碼 改編碼方法]</ref>.


newline count (count the number of lines of a file), word count
newline count (count the number of lines of a file), word count

Navigation menu