Linux Basic series (1)

Source: Internet
Author: User

Linux Basics

First of all, the philosophy of Linux
1 All Documents
2 Small and beautiful apps
3 Combo Applet
4 Avoiding confusing graphical interfaces
5 configuration data stored in text
And then say Shell,shell is a bridge between the user and the Linux operating system the Linux shell type is stored in the/etc/shells file, and cat looks at it.
[Email protected] ~]# Cat/etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
Bash is used by default, and the rules may vary between shells, as follows
[Email protected] ~]#/BIN/CSH
[Email protected] ~]# > F
Invalid NULL command.
[[Email protected] ~]# exit
Exit
[Email protected] ~]# > F
[Email protected] ~]#



And then distinguish between internal commands and external commands.
Internal command:
commands from the Linux kernel
External command:
There is a corresponding executable file under the current system file system directory path

Use the type command to differentiate between internal and external commands
Type Commond
Internal: Bulitin
external: Display as command file path

Hash Cache External Command

When the shell executes the command, it first looks at whether the internal command, if it is, is called directly from the kernel, if not the cache from the external command, if not yet from the $path.

Note: When the command is deleted or moved, the hash is invariant, so you need to delete the corresponding command path in the hash.
Hash-d Commond
Hash-r Empty

enable-disable built-in commands
The Enable command is used to temporarily close or activate the specified shell internal command. To execute the same file name as the shell built-in command, you can use Enable-n to close the shell built-in command. If you do not add the-n option, enable to restart the closed command.

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/84/96/wKioL1eVpGSji_l2AAATlUkmTBs082.png-wh_500x0-wm_3 -wmp_4-s_686661789.png "title=" 2016-07-25_132956.png "alt=" Wkiol1evpgsji_l2aaatlukmtbs082.png-wh_50 "/>

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/84/95/wKiom1eVpJzzh854AAAVYjHXeAI636.png-wh_500x0-wm_3 -wmp_4-s_963089379.png "title=" 2.png "alt=" Wkiom1evpjzzh854aaavyjhxeai636.png-wh_50 "/>


Basic features of bash: shortcut keys

CTRL + A: Jump to the beginning of command
Ctrl+e: Jump to the end of the command line


Ctrl+u: Delete all characters from the beginning of the line to the cursor position
Ctrl+k: Removes all characters from the cursor to the end of the line



Ctrl+l: Clear screen, equivalent to clear



Vmwaretools:vmware Tools is an enhanced tool that comes with VMware virtual machines and only VMware Tools is installed in VMware virtual machines to enable file sharing between hosts and VMS, while supporting free-drag functionality The mouse can also move freely before the virtual machine and host (no more pressing ctrl+alt), and the virtual machine screen can also be full-screen


Install VMware tools to drag files from Windows into a virtual machine in CentOS
1 installing VMware Tools in the Select virtual machine option
2 df to see which directory is being hung
3 CD/MEDIA/VM.
4 CP Vm.tar.gz/testdir
5 Cd/testdir
6 Tar xvf vm...tar.gz
7 CD VMware ...
8./vmware-install.pl D




Command aliases alias (valid only for the current shell)
To set a command alias:
Alias aliases = ' Command '
For example alias cp= ' Cp-i '

To cancel a command alias:
Unalias aliases
Run the original command, skip the alias
1 Absolute path
2 ' command '
3 \command



Date View system time
Clock View hardware time

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/84/96/wKioL1eVqNLR_pS0AAAqXLf1NxU752.jpg-wh_500x0-wm_3 -wmp_4-s_129922231.jpg "title=" date.jpg "alt=" Wkiol1evqnlr_ps0aaaqxlf1nxu752.jpg-wh_50 "/>


Time adjustment
Clock-w the date is the subject of
Clock-s The hardware time is the standard



echo Command options:
-N does not wrap characters at the end of the line
-E If the following character appears in the string, it is handled in particular, not as a general text output:
\a issued a warning sound;
\b Backspace key
[email protected] ~]# echo-e ' ABC\BDF '
Abdf


\c finally not add the line break symbol;
[email protected] ~]# echo-e ' sa\c '
Sa[[email protected] ~]#

\ n Wraps and the cursor moves to the beginning of the line;

[email protected] ~]# echo-e ' a\na '
A
A
\ r The cursor moves to the beginning of the line, but does not wrap;

[email protected] ~]# echo-e ' hello\rxx '
Xxllo

\ t Insert tab;
[email protected] ~]# echo-e ' a\taaa '
A AAA

\ \ insert \ character;
[Email protected] ~]# echo-e ' a\\aaa '
A\aaa

\0NNN insert ASCII character represented by NNN (octal)

[email protected] ~]# echo-e ' \0052 '
*

\XHH Insert the ASCII character represented by the HH (hexadecimal)
[Email protected] ~]# echo-e ' \x52 '
R



Screen users can connect multiple local or remote command lines at the same time, and freely switch between them, must be the same user.


Open a new screen
Screen-s [SESSION]
Join session
Screen-x [SESSION]
Exit and close Screen
Exit
Peel the current screen
Ctrl+a,d
Show all screens that are already open
Screen-ls
Restore a screen
Screen-r [SESSION]

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/84/96/wKioL1eVpsDBtMfVAAAN1bEhgdw021.jpg-wh_ 500x0-wm_3-wmp_4-s_1494879848.jpg "title=" 3.jpg "alt=" Wkiol1evpsdbtmfvaaan1behgdw021.jpg-wh_50 "/>650) this.width=650; "Src=" http://s1.51cto.com/wyfs02/M02/84/96/wKioL1eVpsvxqMsjAAAuw3qC9HE627.jpg-wh_500x0-wm_3-wmp _4-s_1369993512.jpg "title=" screen1.jpg "alt=" wkiol1evpsvxqmsjaaauw3qc9he627.jpg-wh_50 "/>650" this.width=650; " Src= "http://s3.51cto.com/wyfs02/M01/84/96/wKiom1eVp3OSPMj1AAB4Eco8sZM347.jpg-wh_500x0-wm_3-wmp_4-s_2326711766. JPG "title=" screen2.jpg "alt=" wkiom1evp3ospmj1aab4eco8szm347.jpg-wh_50 "/>

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/84/97/wKioL1eVr8mCIuHDAABBIEebtSI834.jpg-wh_500x0-wm_3 -wmp_4-s_1211404023.jpg "title=" screen-exit.jpg "alt=" wkiol1evr8mciuhdaabbieebtsi834.jpg-wh_50 "/>650" this.width=650; "Src=" http://s2.51cto.com/wyfs02/M01/84/97/wKiom1eVr9iym0rIAABBjBpMwBw694.jpg-wh_500x0-wm_3-wmp _4-s_963279257.jpg "title=" exit.jpg "alt=" Wkiom1evr9iym0riaabbjbpmwbw694.jpg-wh_50 "/>

This article is from the "Endless Learning" blog, please be sure to keep this source http://dashui.blog.51cto.com/11254923/1829636

Linux Basic series (1)

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.