Linux's file handling commands

Create a file touch

touch [filename]

cat displays the contents of the file

cat【】

-n line number

例 cat -n /etc/services

tac display file contents

tac file is displayed in reverse order

tac [file name]

more paging file contents

more [filename]

usage:

Blank page or f

Enter Wrap

q or Q to exit

例:more /etc/services

less page display file contents

less [filename]

例less /etc/services

/ Plus Keywords

n represents paging

The first few lines of the file display head

-n Specifies the number of lines

head -n 20 /etc/services

By default the first ten lines

Tail end of a few lines display file

-n Specifies the number of lines

-f dynamic display file contents end

tail -20 /etc/services

ln connection file generation

ln -s source file [file] [target]

-s Create a soft link

ln -s /etc/issue /tmp/issue.soft

Create a soft link files issue of

ln   /etc/issue /tmp/issue.soft

The issue of creating a file hard-wired

Characteristics: Similar to the shortcut window

 

Guess you like

Origin www.cnblogs.com/wangshilin/p/11587320.html