Linux Learning Notes

Source: Internet
Author: User

1. Set password for root account: sudo passwd root

2. Switch to the root account: Su root

3. Sync data from memory to hard drive: Sync
Restart: reboot
Shut down the system: halt or Poweroff or shutdown

Shutdown after 10 minutes: shutdown–h 10

System restarts after 10 minutes: Shutdown–r 10

4, the use of Putty software to connect the virtual machine in the Linux operating system before the need to open sshd service Ubuntu

To make the native SSH service open, you need to install Openssh-server:
sudo apt-get install Openssh-server
Start Ssh-server:sudo/etc/init.d/ssh Start

5, Linux system is a typical multi-user system, different users in different positions, with different permissions. In order to protect the security of the system, the Linux system has different requirements for different users to access the same file (including directory files).
In Linux we can use the LL or LS–L command to display the properties of a file and the users and groups to which the file belongs, such as:
The first character in Linux means that the file is a directory, a file, or a linked file, and so on.
When [d] is the directory
When [-] is the document;
If [l] is indicated as a linked document (link file);
If [b] is indicated as the device file inside the storage interface device (can be random access device);
If [C] is indicated as a serial port device inside the appliance file, such as a keyboard, mouse (one-time reading device).
In the following characters, a group of three, each of which is a combination of three parameters, is "rwx". where [R] stands for readable (read), [W] stands for writable (write), [x] stands for executable (execute). Note that the location of the three permissions does not change, and if there is no permission, a minus sign [-] is present.
The properties of each file are determined by the 10 characters of the first part of the left (for example).


0-9 of these numbers are used to indicate from left to right.
The No. 0 bit determines the file type, and 第1-3位 determines that the owner of the file owns the file's permissions.
第4-6位 determines that the owning group (the same group of users of the owner) has permission to the file, 第7-9位 determines the permissions that other users have on the file.
Where the 1th, 4, 7 is the Read permission, if the "R" character is indicated, then there is read permission, if the "-" character, there is no Read permission;
The 2nd, 5, 8 bits indicate write permissions, if the "W" character is indicated, there is write permission, if the "-" character indicates that there is no write permission, the 3rd, 6, 9 bits indicate the executable permission, if the "x" character is indicated, there is the execution permission, if the "-" character, there is no execute permission.


6. Use of VI Editor

(1) Start VI Editor
VI filename

(2) Exit VI Editor
There are two modes of the VI editor, which must be in command mode in order to exit VI. Tap the "Escape" or "ESC" key (if your terminal does not have this key, you can try \^\[, or control-[) to enter command mode.
Exit VI
: Q
Do not save forced exit VI
: q!
Saving editor Content
: W
Save editor content and Exit VI
: Wq or ZZ
Save the file you are editing as a different file
: w filename2

(3) VI is started in command mode and has several commands to transfer the VI editor to insert mode. The most commonly used commands are a and I. When you are in insert mode, when you tap the exit (Escape) button, you exit this mode. If your terminal does not have this key, \^[or control-[is OK.
H: Move the cursor to the left to the position of one character
J: Move the cursor down one line
K: Move the cursor up one line
L: Move the cursor to the right position of one character
R: Replace the character at the cursor position
U: Undo the last modification to the file, and then enter u again to revert to the last modification
X: Delete the character at the cursor location


7. Before using putty to connect to a Linux virtual machine in VMware, you need to install SSH in Linux

sudo apt-get install SSH

Linux Learning Notes

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.