2nd Day "Introduction to OS Linux distributions, Getting Started with Linux system basics, Linux command Help, Linux basic Commands"

Source: Internet
Author: User
Tags aliases what date

Logout Exit System

Gedit Text Editor Tools

Uname–r View kernel version information, uname–a more details

Cat/proc/cpuinfo viewing CPUs

Cat/proc/meminfo Viewing memory

Hostname Viewing host names

Ifconfig eth0 view eth0 IP Address

Alias ls= ' ls–ll ' setting aliases

To view the path of the current terminal: TTY

View current Shell:echo $SHELL

All Shell:cat/etc/shells under the current system

View CentOS System hostname Format: Echo $PS 1

Distinguish internal or external commands: Type CD

Which find the location from which the Linux command resides

Ls,cd,type,tty,cat,which,whereis,pwd,echo,mkdir,touch,ln,cp,mv,rm,find,

History View Historical Commands

-A: Append the new reply to the. Bash_history text in the home directory.

-D: Delete the command specified in history; History–d 40

-C: Clears the command history;

View files saved in the history table

Environment variables:

Histsize: Number of records in the command history

Histfile:~/.bash_history

Histfilesize: The number of history records in a command history file

!! : previous order;

Copy, delete, move files or directories

Cp-Copy file or directory

-F: Do not alert when overwriting a file or directory with the same name

-I: Alerts users to confirm when overwriting a file with the same name

-P: Preserve the permissions of the source file while copying, which is the same as the main and time tag attributes

-r: This option must be used when copying directories, which means recursively copying all files and subdirectories

Rm--Delete (remove) file or directory

-F: Delete a file or directory without a reminder, and delete the entire directory tree directly

-I: Remind users to confirm when deleting files or directories

-r: This option must be used when deleting a directory, indicating that the entire directory tree is deleted recursively (should be used sparingly)

Mv-Move File or directory

Find command--locate a file or directory

Query by name: keyword '-name ' find/etc–name ' resol*.conf '

Find by file size: The keyword is: '-size '

Search by file owner: The keyword is '-user '

Search by file type: '-type ' keyword

Du: Statistics directory and space occupancy of files

-A: Count all the files that are included in the disk, not just the statistics directory

-H: Show statistical results in a more humane way

-S: Counts the amount of space occupied by each parameter, rather than counting each subdirectory

Aliases for Commands (alias)

View all aliases under the current user: Alias

Set alias: Alias ls= ' Ls–l '

Alias: Unalias ls

Valid only for the current terminal, if you want to be permanently valid, define it in the configuration file:

Valid only for the current user: ~/.bash

Valid for all users:/ETC/BASHRC

Execution takes effect: source ~/.bash

Date command

Show today for weeks

Date +%a

Set Current system time

Date 0815170115.21

Date +%d Month Day

Date +%f Month Day

Date +%t hours, minutes, seconds

Date +%f-%h-%m-%s

MM: Month

DD: what date

Hh: Hours

Mm: Minutes

Yy: two-digit year

CCYY: four-bit year

. SS: Seconds

Get command Help

The path definition for the shell program to search the executable file is in the PATH environment variable

# echo $PATH

Internal command:

--help

External command:

Help

Hash Cache command

Hash View hit command

Hash–r Clear hit All commands

Shutdown operation

Shutdown–h now

Poweroff

Halt

Init0

Restart operation

Shutdown–r now

Reboot

Init 6

Delay Shutdown or restart operation

Shutdown–r +15 ' The system would be reboot!! ' Shut down after 15 minutes

Bash shortcut keys:

Watch out! The shortcut keys here refer to the terminal, not to the text editor.

Crtl+u: Quickly delete all character contents before the current cursor

Crtl+k: Quickly delete all characters at the end of the line at the current cursor

Crtl+l: Quickly delete the contents of the screen and display the command prompt only in the upper-left corner

Crtl+c: Cancels editing of the current command line and switches to a new line of command prompt

Crtl+a: The current cursor jumps quickly to the beginning of the terminal

Crtl+e: Jumps to the end of the command

Text Search

/keyword:

The string specified by keyword as the keyword, from the current to the end of the file search, case-insensitive

N: Previous

N: Next

? KEYWORD:

The string specified by keyword as the keyword, from the current to the file header search, case-insensitive

N: Previous

N: Next

Command Ls displays a list of files under the specified path

-A: Show all files, including hidden files

-L: Long list form

-H: Unit conversion

-D: Displays the relevant properties of the directory itself, typically used with-L.

-R: Reverse mode display

-R: Recursive display

-rw-r--r--. 1 root root 41364 June Install.log

-,d,l,b,c,p,s

Number 1: Number of times a file has been hard linked

Left Root: Owner of File

Right root: Group of files

41364: Siize of files

June 14 14:32: Last modified time for a file

Install.log: File name

File View commands: Cat, TAC

Cat: Forward

Cat/etc/fstab

Cat/etc/fstab/etc/issue

TAC: Reverse Order

Cat/etc/fstab

Cat/etc/fstab/etc/issue

File content Type view command: File

File/etc/fstab

File/bin/cat

File/dev/sda

Echoing command Echo

Echo "$shell"

Which display the path of the command

which LS

--skip-alias: Disable alias display

User Login Related

Who,whiamai,w

Management class Commands

Mkdir Creating a Directory

-P: Exists and does not error, and can automatically create the required directories

-V: Show more information

-M MODE: Specify permissions directly when creating a directory

Rmdir: Deleting a directory

More, less, command

More/etc/httpd/conf/httpd.conf

Press ENTER to scroll down

Press the B key to turn up one screen

Press Q to exit

Head and tail

Head-4/etc/passwd

Time Stamp management tool for files

Touch

View file Status: Stat

Three time stamps:

Access time: Visited: atime

Modify Time: Modified, abbreviated: Mtime

Change Time: Modified, abbreviated: CTime

2nd Day "Introduction to OS Linux distributions, Getting Started with Linux system basics, Linux command Help, Linux basic Commands"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.