Linux Management commands

Source: Internet
Author: User

Three barriers for technician growth:

The ancients succeeded in the three sentences, the ancient people to become major events, the need to go through the triple State:

First goal: Find the direction, set the target

The second goal: tireless, support for a constant decades, such as a day of the bench for the effort;

Third goal: When you inadvertently you will find that your goal is far away from you left behind.

Last night the West wind wither Green tree, alone on high-rise, Monopoly Tianya road.

Emaciated end not regret, for Iraq to eliminate people haggard.

The crowd found him 1100 degrees, suddenly looking back at the person is in the dim place.

There is no valuable thing in the world is easy to learn, three minutes of heat, often change the person eventually accomplished nothing.

Study for a while, also paid a lot of effort, this time period probably need one or a year, but will encounter a threshold, and then want to go up, more difficult, at this time give up, no longer make any efforts, amateur experts, really become experts, to 10 years as a day.

Any one field, adhere to two years to three years, we can experts, adhere to more than five years can become authoritative.

Three days not to learn, Miss Liu Shaoqi.

Graduation, is more bitter than the school, more tired, more crazy days began.



Directory Management:

LS, CD, pwd, mkdir, rmdir, tree


File Management:

Touch, stat, file, RM, CP, MV, Nano


Date Time:

Date, clock, Hwclock, Cal


To view text:

Cat, TAC, more, less, head, tail


Cat:concatenate (Connect and display) from the head to the rear display from the standard input to the standard output.

-N: Show line numbers

-E: Displays the trailing terminator

-T: Show tabs

-V: Display nonprinting characters


TAC: From the tail to the head display

Cat/etc/issue/etc/fstab

CTRL + C, terminating signal, common techniques.


Split-screen display command:

More, less


The usage of more is basically similar to cat, but you can scroll backwards by manually viewing the contents of a page.

The usage of less is basically similar to man's

Less/etc/rc.d/rc.sysinit


Head: View the first n rows of a file, n default is 10

Tail: View the file's after n rows, n default is 10

-N, specifying how many rows to display. A blank line is also a row.


Tail-f, viewing the end of the file does not exit, showing the addition of subsequent content.

At any time, do not deny yourself, do not imply that Murphy's law. To have information, as long as not blind.


Text Processing:

Cut, join, SED, awk (report generation command)

Three great weapons: sed, awk, grep


Database: Databases


Relational database:

Table: Row and column composition, two-dimensional table


Text files: Save the database, separate them with spaces, or specify symbols separately, but with slower indexing.

Tom:23:male:2013/05/06


Cut

-D: Specifies the field delimiter, which defaults to a space.

-F: Specifies the field to display.

-F1, showing the first field 1, 3, showing 1 and 3, 1-3, showing 1 to 3.


commands for text sorting:

Sort, does not affect the order of the source files, only affects the number of displays.

Nano.test, the default is not sorted by numeric size.

Sort

-N: Sorts by the size of the number.

-r: Sorts in reverse order of the size of the numbers.

-T: Field delimiter

-K: Which field is the keyword to sort

-U: The same row is only displayed once after sorting

-F: Ignore character capitalization when sorting


Uniq: Reports which rows are duplicated, or ignores duplicate rows, if the rows are not contiguous, meaning that the rows are not duplicates.

-D: Show only duplicate rows

-D: Show all duplicate rows

-C: Displays duplicate rows and shows several repetitions.


Text statistics: WC (word count)

-L: Show only rows

-W: Show Only words

-M: Displays only the number of characters

-C: Show only the number of bytes

-L: The longest line contains the number of characters


Character processing commands: TR (for converting or deleting characters)

TR [OPTION] ..... Set1[set2] typically use input to redirect < manipulate related characters of text.

Tr ' A-Z ' A-Z ' </etc/fstab

Tr-d: Deletes all characters that appear in the character set.


Bash and its features:

System composition, the closest to the user is the shell.

Shell: The shell, the user connected to the computer program

Gui:gnome,kde,xface

Cli:sh,csh,ksh,bash (following the open source agreement), tcsh,ksh,zsh


Root,student

Program: process, process understood as a copy of the program.


Linux features allow a user to log in multiple times at the same time, for several shells, independent of each other, without interference.

Process: In each process it appears that only the kernel and the current process exist on the current host.

A process is a copy of a program, or an instance of a program execution. The user exits and the shell terminates.


User's working environment:

BASH: Different users login, the environment can be different, the default is the same. Large environments are the same, small environments are slightly different and customizable.


Shell, child shell, Pstree

Bash--bash, do not know the other shell run, only know that the internal launch of a program, most of the parent shell settings, the child shell is invalid, child shell settings, the parent shell is invalid.


Bash:

1. Command history, Command completion

2, Pipeline, redirect

3. Support Command aliases

4. Support Command line editing

5. Command line expansion

6. File name Wildcard

7. Support the use of variables

8. Support Programming


Bash Features:

command-line editing:

Command cursor Jump:

CTRL + a jumps to the beginning of the command

Ctrl+e jump to the end of the command line

Ctrl+u Delete the cursor to the beginning of the command line

Ctrl+k Delete the cursor to the end of the command line

Ctrl+-> or ctrl+<-jump words

Ctrl+l Clear Screen


Command history:

Bash automatically records the execution history of the command by default and stores it in the memory buffer.

View command history: Historical

-C: Empty command history

-D OFFSET [n]: Deletes the specified number of commands, or specifies a range of commands.

Once the user exits normally, the history command is saved to a text.

-W: Saves the command history to the history file.


Environment variables:

Path: Command Search Path

Histsize: Command history buffer size, save 1000 by default.


The use of command history tips:

Up and down arrows turn

!n: Executes the nth command in the command history.

!-n: Executes the reciprocal nth command in the command history.

!! : Executes the previous command.

!string: Executes the most recent command in the command history that begins with the specified string.

!$: You can refer to the last parameter of the previous command

ESC,. Automatically get last parameter of last command

ALT +.: Reference the last parameter of the previous command


Command completion function: (Tab key) (Command start letter, double-tap tab, auto-Complete or list the beginning of the letter option).

Path: The search path for the command

Path completion

For Linux, the text line terminator is a $,windows line terminator with two, carriage return and $ character


Linux Management 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.