Take notes on Linux (1) and take notes on linux

Source: Internet
Author: User

Take notes on Linux (1) and take notes on linux
One sentence is recommended: anyone who can be patient can become coder of the world, including you.

Summary: ubuntu uses the apt-get management package and redhat uses yum.

Linux is divided into four parts: Linux kernel, GNU user program, graphic desktop environment, and application software.
The kernel has four functions:

Program memory management (using virtual memory, physical memory, swap memory), Common commands # cat/proc/meminfo

Software program management (with file inittabs to manage initialization processes), location/etc/inittabs, command # ps ax

Hardware Management (re-compile the kernel, add driver modules to the kernel, and add the Sub-bytes (Device Files partial to the underlying modulation class), blocks (disks with a large number of data blocks ), the network device (the device that sends and receives data packets) system creates a special file for the above device, called a node, with a unique number pair to mark the group ), common commands # ls-al sda * ttys *

File System Management. Unlike other operating systems, linux kernels use different types of file systems and hard disks to transmit data.
GNU utility, the core program of shell.
Graphic desktop Environment, GNOME Desktop (GNU Network Object Model Environment)

Bash shell: echo $ ps1/2, view the current prompt format
Man bash/specific commands, detailed list of functions, flip by Space
The Linux system file directory is a virtual directory structure that contains a basic directory and becomes the root directory. The directories and files under the root directory are listed based on their paths, which is similar to windows. There is also the difference between a forward slash and a backslash. in Linux, a forward slash represents the file directory, but a backslash rather than an escape sign.
The most amazing part of the Linux virtual directory is to create some special directories named mount points in the root drive in combination with each storage device. The mount point is

A virtual directory is the directory used to allocate additional storage devices. It is the root association between a hard disk and a virtual directory. For example, the user directory is mounted to the home location.

Introduction to common Linux directory files:

/Bin: a binary directory that stores many GNU user-level utilities;

/Sbin: system binary directory that stores many GNU management-level utilities;

/Boot: directory for storing boot files;

/Dev: Device directory. Linux creates a device node in this directory;

/Etc: system configuration file directory;

/Home: main directory. Linux creates a user directory in this directory;

/Lib: Library directory, storage system and application library files;

/Mnt: Mount directory, another common mount point for removable media devices;

/Media: media Directory, which is a common mount point for removable media devices;

/Opt: optional Directory. Optional software packages for storing common terms;

/Root: root main directory;

/Tmp: temporary directory for storing temporary work files created and destroyed;

/Usr: directory for installing software;

/Var: a file that is frequently changed, such as a log file.


Learn the cd command: absolute path, relative path (./or ../);
File List: ls-F (the forward slash represents the Directory)-a (display stealth)-l (detailed information)-R (display directory file)-I (display index number) filter list output: ls-l test (this is a keyword, can be used? Or wildcard characters)

File Processing: touch creates an empty file with-t specifying the timestamp, cp copying the file,-r recursive copying the file,-R recursive directory, and-p keeping the copy time consistent with the source file, move or rename a music video file, rm delete the file, and-r recursively delete the file.


Create the mkdir directory and delete the empty directory by using rmdir.

Stat: View file statistics. file: View file types. There are three types: text files, executable files, and data files.
Cat: view the entire file.-n indicates the serial number, and-B indicates the serial number only.
More: displays the entire file by page. less is also more powerful than more. You can display the total number of data rows and the number of rows before loading the entire file.

Tail: view the last 10 lines of the file, head: view the first 10 lines of the file-how many lines are displayed before and after the n lines.


PowerTOP is an open-source command line tool used to diagnose power consumption problems and view the activity of software applications in the system. In addition, it provides various ways of interacting with power management settings for testing.

Installation: select different installation commands based on your system version.

Ubuntu 14.04 installation command:

Sudo add-apt-repository ppa: tsvetko. tsvetkov/trusty-backports
Sudo apt-get update
Sudo apt-get install powertop

Uninstall command:

Sudo apt-get remove powertop

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.