Linux learning (a) Linux learning (a)

The most commonly used seven Linux command:

cd: Change directory.

pwd: View current directory.

ls: view files in the directory.

touch: No files you create the file.

mkdir: create directory.

mr: remove deleted. -r can delete the directory

clear: clear the screen.

Files and directories for commonly used commands

View directory contents

ls

    -a: View hidden files

    -l: View details

    -h: -l with the use of user-friendly displays the file size

ls wildcard

    *: Represents any number of characters

    ?: Indicates any one character

    []: Represents any character can match a group

    [Abc]: represents a ratio with a, b, c of any one of

    [Af]: to match any character within a range of f

        

 

Change directory

cd

    cd: switch the current user's home directory

    cd ~: ditto

    cd:. maintained in the current directory

    cd ..: Switch to the parent directory

    cd -: to switch between the last two working directory

 

Create and delete operations (when creating a dot (.) At the beginning of the file is a hidden file)

touch

    If the file does not exist, you can create a blank file

    If the file already exists, you can modify the last modification date of the file

mkdir

    -p: create directories recursively

rm

 

Copy and move files:

tree (tree display)

-d: show only directory

cp [object address] [copied into the directory address]

-i: covered prompt before files

-r: If all the subdirectories and files directory files recursively copy directory

mv

May be used to move a file or directory, the file or directory may be renamed

 

 

View the file contents

cat

    View the contents of the file, create a file, file merging, additional features such as file content

    -b: display non-empty rows

    -n: display all rows

more

    Split-screen display file contents

 

grep

    Search the contents of a text file

    -n: display the line number

    -v: Display all match line does not contain text (inverted)

    -i: ignore case

    Parameters: ^ a: first row, beginning with a line search

         ke $: end of the line, end of line searches to ke

 

other:

echo

Redirect> and >>

    The results of the command to redirect one more file

    >: Indicates the output file will overwrite the original Neri

    >>: Indicates the end of the additions, the contents will be appended to the existing content

Pipeline |

    Input of a command through the pipeline as input to another command

The most commonly used seven Linux command:

cd: Change directory.

pwd: View current directory.

ls: view files in the directory.

touch: No files you create the file.

mkdir: create directory.

mr: remove deleted. -r can delete the directory

clear: clear the screen.

Files and directories for commonly used commands

View directory contents

ls

    -a: View hidden files

    -l: View details

    -h: -l with the use of user-friendly displays the file size

ls wildcard

    *: Represents any number of characters

    ?: Indicates any one character

    []: Represents any character can match a group

    [Abc]: represents a ratio with a, b, c of any one of

    [Af]: to match any character within a range of f

        

 

Change directory

cd

    cd: switch the current user's home directory

    cd ~: ditto

    cd:. maintained in the current directory

    cd ..: Switch to the parent directory

    cd -: to switch between the last two working directory

 

Create and delete operations (when creating a dot (.) At the beginning of the file is a hidden file)

touch

    If the file does not exist, you can create a blank file

    If the file already exists, you can modify the last modification date of the file

mkdir

    -p: create directories recursively

rm

 

Copy and move files:

tree (tree display)

-d: show only directory

cp [object address] [copied into the directory address]

-i: covered prompt before files

-r: If all the subdirectories and files directory files recursively copy directory

mv

May be used to move a file or directory, the file or directory may be renamed

 

 

View the file contents

cat

    View the contents of the file, create a file, file merging, additional features such as file content

    -b: display non-empty rows

    -n: display all rows

more

    Split-screen display file contents

 

grep

    Search the contents of a text file

    -n: display the line number

    -v: Display all match line does not contain text (inverted)

    -i: ignore case

    Parameters: ^ a: first row, beginning with a line search

         ke $: end of the line, end of line searches to ke

 

other:

echo

Redirect> and >>

    The results of the command to redirect one more file

    >: Indicates the output file will overwrite the original Neri

    >>: Indicates the end of the additions, the contents will be appended to the existing content

Pipeline |

    Input of a command through the pipeline as input to another command

Guess you like

Origin www.cnblogs.com/9946xyz/p/10987570.html