Some basic knowledge of Linux Getting Started

Source: Internet
Author: User
Tags exit empty oracle database

"How graphics and text mode are switched"

Linux presets provide six command window terminals let's log in. The default we are logged in is the first window, that is, Tty1, the six windows are Tty1,tty2 ... tty6, you can switch them by pressing CTRL + ALT + F1 ~ F6. If you have a graphical interface installed by default, you can press CTRL + ALT + F1 ~ F6 to enter one of the command window interfaces. When you go to the Command window interface and return to the graphical interface, just press CTRL + ALT + F7 and come back. If you use the VMware virtual machine, the Command window toggles the shortcut key to Alt + Space + f1~f6. If you are in the graphical interface, press ALT + Shift + Ctrl + F1~F6 to switch to the command window.

"Learn to use shortcut keys"

CTRL + C: This is the shortcut to terminate the current command, but you can also enter a large string of characters that you don't want it to run directly CTRL + C, and the cursor jumps into the next line.

Tab: This key is the most useful key, but also the author of the highest probability of hitting a key. Because when you hit half of a command, it will help you complete it. Not only is the command, when you hit a directory, the same can be filled, do not believe you try.

Ctrl + D: Exit the current terminal, and you can also enter exit.

Ctrl + Z: Pauses the current process, such as you are running a command, suddenly feel a bit of a problem to pause, you can use this shortcut. After a pause, you can use FG to recover it.

Input man ls In fact the format is man + command

You'll see the relevant help documentation. From the introduction of the command to the parameters of the command and the use of the introduction are very detailed. It's not bad.

"Linux system directory Structure"

When you log on to the system, enter LS in the current command window/you will see

Ctrl + L: Clear the screen so that the cursor moves to the first line.

"Learn to query Help document-man"

This man is usually used to look at a command's help document. For example:

The following is an explanation of these directories:

/bin bin is the abbreviation for binary. This directory holds the most frequently used commands.

/boot Here are some of the core files used to start Linux, including connection files and mirrored files.

/Dev Dev is an abbreviation for device (equipment). The directory is a Linux external device that accesses the device in Linux and accesses the file in the same way.

/etc This directory is used to store all the configuration files and subdirectories required for system administration.

/home user's home directory, in Linux, each user has a directory of their own, generally the directory name is named after the user's account.

/lib This directory holds the most basic dynamic connection shared library of the system, which acts like a DLL file in Windows. Almost all applications need to use these shared libraries.

/lost+found This directory is usually empty, and when the system shuts down illegally, some files are stored here.

/media Linux system will automatically identify some devices, such as U disk, optical drive, etc., when identified, Linux will identify the device to mount to this directory.

The/MNT system provides this directory to allow users to temporarily mount other file systems, we can mount the optical drive on the/mnt/, and then enter the directory to view the contents of the CD-ROM.

/opt This is the directory where additional software is installed for the host. For example, if you install an Oracle database, you can put it in this directory. The default is empty.

/proc This directory is a virtual directory, which is the mapping of system memory, we can access this directory directly to obtain system information. The contents of this directory is not on the hard disk but in memory, we can also directly modify some of the files inside, such as the following command to screen the host ping command, so that others can not ping your machine:

echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all.

/root This directory is the user's home directory for system administrators, also known as super privileges.

/sbin S is the meaning of super User, where the system Admin program used by the system administrator is stored.

/selinux This directory is unique to the Redhat/centos directory, SELinux is a security mechanism, similar to Windows Firewall, but this set of mechanisms is more complex, this directory is to store SELinux-related files.

/srv This directory holds some data that needs to be extracted after the service is started.

/sys This is a big change in the linux2.6 kernel. This directory installs a new file system Sysfs in the 2.6 kernel, SYSFS file system integrates information from the following 3 file systems: Proc File system for process information, DEVFS file system for devices, and devpts file system for pseudo terminal. The file system is a visual reflection of the kernel device tree. When a kernel object is created, the corresponding files and directories are also created in the kernel object subsystem.

/tmp This directory is used to store some temporary files.

/usr This is a very important directory, users of many applications and files are placed in this directory, similar to Windows under the Program Files directory.

/usr/bin: Applications that are used by system users.

/usr/sbin: A more advanced management program and System daemon used by Superuser.

/USR/SRC: The default drop directory for kernel source code.

/var This directory is stored in a constantly expanding, we are accustomed to those often modified directories in this directory. Includes various log files.

In the Linux system, there are several directories are more important, usually need to be careful not to accidentally delete or change the internal files. /ETC: It also mentions that this is a configuration file in the system, and if you change a file in that directory, it may cause the system to fail to start. /bin,/sbin,/usr/bin,/usr/sbin: This is the place directory of the system preset execution files, such as LS, in the/bin/ls directory. It is worth proposing that,/bin,/usr/bin is the instruction for system users (except for the general-purpose user outside root), and/sbin,/usr/sbin is the instruction for root use. /var: This is a very important directory, the system ran a lot of programs, then each program will have a corresponding log generated, and these logs are recorded in this directory, specifically in the/var/log directory, the other mail preset placement is here.

"How to properly shut down"

In fact, in the Linux domain mostly used in the server, rarely encountered shutdown operation. After all, the server running a service is never-ending, unless special circumstances, the last resort will be shut down.

Linux and Windows are different, under Linux, because every program (or service) is executed in the background, there may be quite a number of people working on your host, such as browsing the web, sending letters, sending files in FTP, and so on. If you press the power switch directly to shut down, then other people's data may be interrupted! That would be a headache! In addition, the biggest problem is that if the shutdown is not normal, it may cause damage to the file system (because too late to write data back to the file, so some service files will have problems!)).

If you are shutting down, you must ensure that no other users are online in the current system. You can give the WHO this instruction, and if you want to see the online state of the network, you can release netstat-a this instruction, and to see the background to execute the program can execute ps-aux this instruction. Use these instructions to let you know a little about the current state of use of the host! (these commands will be mentioned in later chapters, so just know!)

The correct shutdown process is: SYSNC? Shutdown? Reboot? Halt

The code is as follows:

Sync

Synchronizes data from memory to the hard disk.

The code is as follows:

Shutdown

Shutdown instructions, you can look at the help document for man shutdown. For example, you can run the following command to turn off the machine:

The code is as follows:

Shutdown–h 10

' This server would shutdown after mins ' tells you that the computer will be shut down in 10 minutes and will be displayed on the current screen of the logged on user.

The code is as follows:

Shutdown–h now

Turn off the machine immediately.

The code is as follows:

Shutdown–h 20:25

The system will shut down 20:25 today.

The code is as follows:

Shutdown–h +10

Shutdown in 10 minutes.

The code is as follows:

Shutdown–r now

The system reboots immediately.

The code is as follows:

Shutdown–r +10

System reboots after 10 minutes.

Reboot is a reboot, equivalent to Shutdown–r now

Halt shut down the system, equivalent to Shutdown–h now and Poweroff

Finally, whether to reboot the system or shut down the system, first run the sync command to write the data in memory to disk. The shutdown command has shutdown–h now halt Poweroff and Init 0, and the command to reboot the system has shutdown–r now reboot Init 6

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.