Linux Programming Learning Notes

Source: Internet
Author: User

The development trend of Linux is imperative, the domestic server operating system Linux occupies the dominant position, not only the operating system, but also the embedded system.

1, today on one of the Linux version of the introduction, the following is the CentOS version of the difference between.

Install or upgrade an existing system installs or upgrades existing systems, the install system with basic video driver installation process uses the basic graphics driver, Rescue the install system into into system repair mode, boot from local drive, memory test

2, referring to the Linux shutdown settings, direct use of the command, the correct process is sync-->shutdown--->reboot--->halt, see Help with the man parameter

Sync is synchronizing the data with memory to the hard disk.

Shutdown-h 10 means this server would shutdown after mins '

Shutdown-h now says shut down immediately.

Shutdown-r now system immediately restarts Shutdown-r +10 system to start in 10 minutes

Reboot is the meaning of a reboot, equivalent to Shutdown-r now

Halt shutdown system, equivalent to Shutdown-h now and Poweroff

3, the Linux system directory

Enter LS you will see the following directory interface, its tree structure: The following describes the file attributes of each directory

    • /bin:
      The bin is the abbreviation for binary, which holds the most frequently used commands.

    • /boot:
      Here are some of the core files used when starting Linux, including some connection files and image files.

    • /dev:
      Dev is the abbreviation for device, which stores external Linux devices, and accesses the device in Linux in the same way that it accesses files.

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

    • /home:
      The 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 contains the system's most basic dynamic connection shared library, which acts like a DLL file in Windows. These shared libraries are required for almost all applications.

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

    • /media:
      The Linux system automatically identifies some devices, such as a USB flash drive, an optical drive, and so on, and when identified, Linux will attach the identified device to this directory.

    • /mnt:
      The directory is provided to allow users to temporarily mount other file systems, we can mount the CD-ROM drive on the/mnt/, and then enter the directory to view the contents of the CD-ROM.

    • /opt:
      This is the directory for the host to install additional software. 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, it is the mapping of system memory, we can access this directory directly to obtain system information.
      The contents of this directory are not on the hard disk but in memory, we can also directly modify some of the files inside, such as can be used to block the host ping command, so that others cannot ping your machine:

      1>/proc/sys/net/IPv4/icmp_echo_ignore_all   
    • /root:
      This directory is a user home directory for system administrators, also known as super-permissions.

    • /sbin:
      S is the Super user's meaning, which is stored in the system administrator's use of the System Management program.

    • /selinux:
      This directory is a unique directory of Redhat/centos, 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 data that needs to be extracted after some services are started.

    • /sys:
      This is a big change in the linux2.6 kernel. This directory installs a new file system Sysfs that appears in the 2.6 kernel.

      The Sysfs file system integrates information from the following 3 file systems: The proc file system for process information, the Devfs file system for the device, and the Devpts file system for the 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, the user's many applications and files are placed in this directory, similar to the Program Files directory under Windows.

    • /usr/bin:
      The application that the system user uses.

    • /usr/sbin:
      Super users use the more advanced hypervisor and System daemon.

    • /usr/src: The default drop directory for the kernel source code.

    • / var:
      This directory is stocked with things that are constantly expanding, and we are accustomed to placing directories that are often modified in this directory. Includes various log files.

4, user name password forgotten how to find the changes

Restart the system press ENTER in three seconds, enter the letter E

Add a single to the back

Start single-user mode by letter B,

When entering the single-user mode input password change the password, then reboot the system is OK.

5, if the system damage how to crack

Using the system rescue mode, the rescue mode is mainly, the system damage can not enter, or grub corruption, or a configuration file corruption error, the use of CD-ROM boot mode, press F5 into the rescue mode,

Enter Linux Rescue carriage return, select language for English

Do not select the network settings, the next will be mounted in the/MNT/SYSIMGE system, there will be three options

Continue refers to the mount after the next step, read_only Mount read-only, skip skip. Choose Continue here

After the system mounts to the file, enter chroot/mnt/sysimage into the admin environment

Enter LS to see that the file system is the same as before.

6, the latter chapter of Linux remote login problem

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