Linux common commands vi Introduction

linux common commands

ls -a list all files including the "." At the beginning of the hidden files

ls -l lists the file name, but also displays the file type, permissions, owner information

ls -al list all files in the file name, type, permissions and other information

ls - / filename / | more split-screen display contents of the file (if a screen display does not come out)

reboot reboot the operating system

ifconfig displays the IP address, including network card (first term)

uname -a displays the kernel version (the kernel version is substantially in the form rxy wherein x is an even number if the change represents a relatively stable system i686 or i386 32-bit x86_64 representative of the representative system 64)

WHO host user to view currently logged

history display command entered simple way is! No.

pwd display the current position

cd ~ handover home directory

cd .. Return to previous

cd ../ .. on return to the previous

use sha512 hash algorithm cat linux read the file content files stored in the default account password stored in the shadow or passwd user password window stored in the sam file

more less head tail type more text can be displayed split screen display text more less similar type but it can freely display and can only be turned forward and more turning back

head -n - x (x behalf of several lines) shows the first few lines of text by default is 10 lines similar tail and head

--- end --- restore content

ls -a list all files including the "." At the beginning of the hidden files

ls -l lists the file name, but also displays the file type, permissions, owner information

ls -al list all files in the file name, type, permissions and other information

ls - / filename / | more split-screen display contents of the file (if a screen display does not come out)

reboot reboot the operating system

ifconfig displays the IP address, including network card (first term)

uname -a displays the kernel version (the kernel version is substantially in the form rxy wherein x is an even number if the change represents a relatively stable system i686 or i386 32-bit x86_64 representative of the representative system 64)

WHO host user to view currently logged

history display command entered simple way is! No.

pwd display the current position

cd ~ handover home directory

cd .. Back on a


cd ../ .. superior return


cat reads the contents of the file linux files stored account passwords by default use sha512 hash algorithm in the passwd or shadow window to store user passwords stored in the sam file

more less head tail type more text can be displayed split screen display text more less similar type but it can freely display and can only be turned forward and more turning back

head -n -x (x behalf of several lines) shows the first few lines of text line 10 defaults to tail and tail to head similar to display several lines of text at the end of line 10 is the default

 The number of lines of text output wc, wc -C bytes byte count display wc -l display line

grep rows containing matching the default print content generally pipe symbol by "|" e.g. cat / etc / passwd | grep sdy display command is passwd file contains the following contents of sdy

touch create a blank file mkdir to create a directory rmdir deletes a directory with rmdir rm function when deleting files similar representation to force the removal (known file is useless unless it's best not to use file) with rm -rf

cp copy mv move useradd userdel add users delete users passwd to set each field 1. The role of the account name of the user password passwd 2. Password to now be represented by x, stored in the shadow of

3. User Identifier (UID) 4. GID (group name specification is mainly used) 6. Description 5. home directory user information

Usermod is used to modify the set of user accounts who am i to view their own permissions find Find su chmod user to switch the authority to change the file or directory chown to change the owner of a file or directory

chgrp umask used to change the file or directory belongs to the group setting file default The default is to generate a mask (0022)

 

vi Introduction

vi and vim compiler compiler similar, except that the compiler vim is an enhanced version of vi

vi compiler has several modes

1. Enter Command Mode 2. Mode 3 Mode 4. Find Mode compiled

1: shift +: command mode exit command mode Press esc w is stored in the command mode exit wq q is q is forced to save and exit Quit exit w wq forcibly forced to save save set nu show line numbers!!!   

2: a start position of the cursor from the back, new data inserted starting i o data from the cursor location of the cursor at a new column and the input mode or the x Backspace Delete yy represents dubbing information will be copied before the copy p to this line 

dd Delete cursor line a few lines #yy u editing operation #dd front undeleted copy includes a cursor includes a cursor of a few lines

3: Move the cursor up and down direction keys or the first line of the file hjkl gg skip skip G file last line

4: In command mode by pressing / or file name? Find the file name / and? The difference / A lookup from the beginning of the article? A lookup from the end of the article

 

Guess you like

Origin www.cnblogs.com/zhao-yang/p/11708073.html