Linux core system command

Shutdown, reboot:

shutdown -h now: Shutdown

shutdown -r now: reboot

File and directory operations command:

pwd: Displays the current location path

cd: Change directory

cd -: switching to a path where

cd ~: switching the system to the variable "HOME" directory corresponding to, i.e., home directory path where

cd ..: Switch to the parent directory

tree: the display contents of the directory tree structure

tree -d: show only directory

tree -L level: directory traversal maximum number of layers, level positive integer greater than 0

Installation tree command:

rpm -qa tree

yum -y install tree

Solve the garbage command: LANG = en_US.UTF-8

mkdir: create directory

mkdir -p: recursively create a directory, meaning the parent directory and its subdirectories and its subdirectories (mkdir -p nba / laker / Bryant)

touch: create an empty file or change the file timestamp property

touch a.txt b.txt (create multiple files, separated by spaces)

ls: display contents of the directory and associated attribute information

ls -l: use a long list format file and directory information

ls -a: shows all files in the directory, including hidden files start with a character. ""

ls -t: according to the last modification time of ordering, the default file name sorting

ls -r: Sort according to the reverse order

ls -F: In the file with the file type indicator

*: Executable files

/ :table of Contents

=: Socket

| :FIFOs

@: Symbolic link

ls -ld: When operating in a directory, lists the files in the directory itself and not the directory information

ls -h: shows the size of the file or directory (e.g. 1KB, 234MB, 2GB)

cp: copy files or directories

ls -a: keep the copy source file owner, permissions information and the time attribute; if the copy of the source file is a symbolic link, then only copy the symbolic link itself, but also keep the target file or symbolic link points to a directory; recursive copy directories

mv: Move or rename a file

mv [options] [source] [destination file]

rm: delete a file or directory

rm -f: thump thump thump thump! Forced to delete! Not prompt for confirmation!

find: Find Files directory (refer to the specific use of other materials, temporarily not write)

chown: change the file or directory users and groups

chown [options] [users. User Group] [file or directory]

chown -R: recursively users and change the directory group (chown -R oldboy.oldboy dir2 /)

chmod: change file or directory permissions

chmod [options] [pattern] [file or directory]

chmod -R: recursively change the file or directory permissions (chomd -R 777 dir2 /)

File permissions rwx; read-write executables; 421

rwx rwx rwx; is a limit sovereignty belongs to the group permission bits other user rights

In the content viewing and editing:

cat: merge files, or view file contents

cat -n: row number starting with 1 for output of all content

cat -b: -n and similar, but ignores the blank line number

Merge files: cat file.tet file2.txt> newfile.txt

less: page display file contents

less -N: display each line number

head: file contents header (first 10 lines)

tail: tail display file (the line 10)

vi / vim: plain text editor

vim three modes: Normal mode (normal mode pressing i enters edit mode), the edit mode, command mode (normal mode, enter a ":", the cursor is positioned on that line, you may perform the save and exit, search, replace , operation display line numbers and the like)

: Wq to save and exit

: Wq! Forced to exit and save

: Q! Forced to exit without saving

Text Processing Three Musketeers:

grep: Text filtering tools

grep [parameters] matching patterns [Find file]

sed: character stream editor

sed [options] [sed built-in command character] [input file]

awk

 

 

 

 

 

 

 

 

  

Guess you like

Origin www.cnblogs.com/lwfiwo/p/11274148.html