Linux-ubuntu Study-Second article

Source: Internet
Author: User
Tags scp secure copy secure copy ssh server

10.grep is a powerful text search tool in Linux systems. The main purpose is to search for key instructions, data, regular expressions, and so on.
11. Open the soft keyboard: ctrl+alt+t, input onboard, if not installed this soft keyboard program, directly to the graphics library download: onboard sudo apt-get install onboard, or sudo yum install onboard.
12.Linux allows the command execution result to be redirected to a file; Echo (Repeat, echo) redirection concept, mainly used to display in the terminal "Output/append" to our designated folder.
13.linux allows the output of one command to be piped as input to another command. The left is the output, the ZIP code is input, i.e. left write right read.
14.linux physical network card is generally used ensxx, virtual machine or Ethx said, learned CCNA should be clear, ping this principle from submarine sonar detection, ping is sonar sound , and Windows to distinguish: Windows View network card is Ipconfig,linux is ifconfig, be sure to pay attention to; In addition, terminate the ping command and Windows, UNIX-based devices such as switches, routers and other device commands, most with the CTRL +c.
15.SSH, is secure shell, are often used, the difference and FTP, pop and telnet plaintext weak password features, encryption to improve security, compression data to increase the speed of transmission; In addition, the connection method will be used, Linux or UNIX can be used directly in the terminal, Windows can not directly use SSH command, need to assist the program can, need to install putty, Xshell or CRT and other software can, the original is different from the core, the shell can not be universal; In case of insufficient rights, the front plus sudo (super permission) command, Eg:sudo Shutdown-r now.
16. The local physical machine connected to the virtual machine on Linux or UNIX, here need to understand the principle of connection, many people will only see what other people knock orders or the like; To check the reasons can be, first of all to ensure that the two systems connected to the concept of pipe, that is, shell to core to the core, and then to the shell, So first to confirm that both sides of the system are open, SSH is open, and then confirm whether the state of the connection is blocked by other system software, the typical is the software firewall (directly look at the online line); sudo apt-get install ssh In addition, the SSH connection will appear when the. ssh file, this file is SSH connections when the confirmation record, the next time the connection will not need port number settings, do not need to reconfirm, directly enter the password connection.
17. Understand the concepts and relationships of users, user groups, other users, cat displays file information, gedit Open file.
18. Modify the user/group permissions on the file/directory, and elevate the privileges with chmod +rwx, which is a little different from the graphical interface of window.
19. Standard users can only be in their own system directory activities, can not modify the system settings related permissions, but Superuser root can be, Su is substitute user's abbreviation, sudo is to execute the command as root, the first time to use the speed must enter the command, You don't need to enter your password again in 5 minutes.
The. cat file name
Cat 123.txt "concatenate connection, combine to view file contents, create files, merge files, append file contents and other functions
The more file name
More 123.txt "More" split screen display file contents
Split screen display large file content, want to see more press SPACEBAR on the line, small files or a screen display "
grep search text filename grep search text file contents
Cat-b 123.txt to non-null output line number
Cat-n 123.txt All line numbering for the output
"More 123.txt
Connect SPACEBAR "Show next screen
Enter next line
B Back to a screen
F Front roll forward one screen
Q quit
Grep-n fa 123.txt display matching lines and line numbers
Grep-v FA 123.txt Display all lines that do not contain matching text
Grep-i FA 123.txt ignores case
GREP-VN fa 123.txt displays matching lines and line numbers, and also displays line numbers with no content, so you can conveniently correspond to the previous cat-n 123.txt
Grep-i "Hello python" 123.txt regular expression
grep-in "Hello python" 123.txt regular expression in which line
^a the beginning of a row, searching for a line starting with a
ke$ the end of a line, searching for a line ending with Ke
grep ^fa 123.txt Displays content that starts with FA
grep fa$ 123.txt displays content ending in FA
Grep-n ^fa 123.txt Displays the contents starting with FA with line numbers.
Grep-n fa$ 123.txt Displays the content ending in FA with a line number.
echo Hello python >a the Hello python output to a file
LS-LH >a The details of the directory are exported to the AH file, but overwrite the previous redirect to the A file.
echo Hello python >>a append hello python to the a file just now
The Tree >>a tree is appended to the A file
LS-LH |more split screen display LS-LH command output content
Ls-lha ~|grep-n FA Split screen displays the contents of the output of the LS-LH command with the content of FA and loses the travel number
Remote Management Common commands
Shutdown option (Shutdown/restart) time does not specify options and time default is 1 minutes to start shutdown
Shutdown-r restart
Shutdown now shut down the machine.
Shutdown-c the shutdown command before canceling
Ifconfig Configure a network interface view/Configure your computer's current NIC configuration information
Ping IP Address detects if the destination IP is connected properly
Ifconfig | grep inet Filtering The inet content inside the ifconfig information
Ssh
SSH [-P port] [email protected] "User: The username on the remote machine, if you do not specify the default current user name
Remote: The address of the long-range machine, which can be a ip/domain name or an alias
Port is the ports that SSH server listens on, and if not specified, the default is 22 "
ssh-p [email protected] Connect to the Ubuntu host on the virtual machine
commands for remote copy files commonly used under SCP secure copy Linux
SCP [-P port] [email protected] and ssh command basically similar, to specify the port on-p, do not specify the port to write remote copy command
Scp-p Port 45.py [email protected]:D esktop/45.py copy 45.py from the current directory to a desktop 45.py file on a device with a remote IP address
Scp-p port [email protected]:D esktop/45.py 45.py copy 45.py from the remote device desktop to a local 45.py file
Add-R to transfer folders
SCP-R demo [email protected]:D esktop Copy the demo from the current directory to Desktop in the remote home directory
scp-r [email protected]:D esktop demo to copy Desktop from the remote home directory to the demo folder in the current directory
Eg:scp-p 22-r [email protected]:D Esktop Demo
ssh-p [email protected] need to enter a login password
Ssh-keygen ssh-keygeneral generate SSH encrypted key file, this file in the home directory of the. ssh file, press Enter directly, for security purposes, you can rename, and so on.
Ssh-copy-id Tom 192.168.222.128 copy Tom Computer User's key file to the attached computer user name under the. SSH folder, the next SSH connection will not need to enter a password, that is, trust the user.
Gedit file name opens in the same directory
CD. SSH set up remote PC configuration information for a password-free login
Touch Config
Gedit Config
"Host Tom
HostName 192.168.222.128
User Tom
Port 22 "
Scp-r ~/desktop Tom:desktop/demo Remote PC Desktop folder all copied to Tom computer's desktop Demo folder inside
Ls-l
"File d directory rwx read Write EXecute
-rw-rw-r--1 tom Tom 0 Jan 18:02 123 (copy). txt
-rw-rw-r--1 tom Tom 12:39 123.txt
-rw-rw-r--1 tom Tom 0 Jan 18:02 123.txt~
-rw-rw-r--1 tom Tom 0 Jan 21:15 333.txt
-rw-rw-r--1 tom Tom 0 Jan 21:16 366.txt
-rw-rw-r--1 tom Tom 0 Jan 14:05 56.py
-rw-rw-r--1 tom Tom 808 Jan 14:06 A
Drwxrwxr-x 3 tom Tom 4096 Jan 18:06 A1
Drwxrwxr-x 2 tom Tom 4096 Jan 18:05 b
Drwxrwxr-x 2 tom Tom 4096 Jan 20:43 N
Drwxrwxr-x 3 tom Tom 4096 Jan 21:27 test
"" X is execute executable
"" The first rwx refers to the user Tom's permissions, the second rwx refers to the user group Tom's permissions, the third rwx is the rights of other users
The number 1/1/1/1/1/1/1/1/13/2/2/3 represents the number of hard connections, which means that there are many ways to access the current directory/file. "
Number of hard connections "file can only be one hard connection number-absolute path
A folder can have multiple hard connections-absolute path +CD. +cd. + (Different subfolder directories below) CD:
In fact, with absolute path + the same level directory + different subdirectories to the top level directory of the path "
chmod change mode changing user/group permissions on directories/files
chmod +/-rwx File/directory name these commands can only be executed under the Linux partition, and may be understood to increase or decrease the permissions of directories and files only under the system partition under their own users
"Eg:chmod-rw 01.py
chmod +r 01.py
chmod +x 01.py "" Reduces read and Write permissions for 01.py files
Add 01.py of readable permissions
Add 01.py of executable permissions "
./01.py represents the execution of 01.py files in the current directory
The Group Management Terminal Command Terminal commands need to be stored in the/etc/group file by sudo command execution group information
Groupadd Group name Add Group
Groupdel Group name Delete Group
Cat Etc/group Group name Confirmation Group information
CHGRP-R group name File/directory name recursively modify the owning group of the file/directory
"Eg:sudo Groupadd Dev
sudo groupdel Dev "Develop development adds Dev group that can be viewed with cat/etc/group
Experiment: mkdir python,sudo groupadd dev/desktop,sudo chgrp-r Dev python/

Linux-ubuntu Study-Second article

Related Article

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.