linux--Composition and general Instructions (1) __linux

Source: Internet
Author: User
1. Environment Variables

Definition: To store information about the shell session and the working environment. It allows you to store in memory in order to run program and script access on the shell. (In short, it's the working environment)

Instructions
Global environment variables
Printenv (command to view all Global environment variables)
Echo (View the value of a single environment variable, such as Echo $HOME)
Local environment variables (visible only in the process that defines them, the process exits, and the variables are gone)
Export (set local variables, such as: Export TEST=KKK)
unset (Delete environment variable)
To keep the variable in effect, after restarting the machine, the variable is still there and needs to be modified/etc/profile file 2. File processing traversal file mode
(1) Absolute path (the exact location of the file path in the directory structure.) Equivalent to the full name of the directory)
such as: Cd/usr/lib
(2) Relative path
The single point character (.) represents the current path; the two-point character (..) represents the parent directory of the current directory
such as: CD. /Management Files
File Creation View
Touch File Create File
CP SRC DST replication files
Ln–s src DST link file
MV Rename
mkdir Create a directory
Cat View full Content
More Paging view
Tail View End
Head View 3. Monitoring Procedures

PS-EF # View All Processes
Top # Real-time display of process status
PS-AUXW # enumerates current process IDs
Kill XX Process ID # terminate single process
Killall Program Name # All processes that terminate the program
User
AddUser #增加用户
Deluser #删除用户4. Network Command

ifconfig# Displays network information, including IP address, packet receive/send status
Ifconfig eth0 up # start eth0
Ifconfig eth0 down # close eth0
cat/etc/resolv.conf# View DNS Servers
/etc/network/interfaces# Manually configure network files
wget http://xxx.com/xx.tar.gz # Download
Extract Files
TAR-ZXPF xx.tar.gz# Decompression
Setup program
Apt-get Install
RPM-QA # View all installed Packages
Service XX (services) Restart | Stop | start# Reboot | stop | start XX service
Hard disk Mount
Fdisk-l # View all partitions
MOUNT-T hard disk type hard drive mount point?
(Type of hard disk: Fat is Msdos,fat32, VFAT,NTFS is NTFS)?
Fdisk-l # View hard drive and all usage
mkdir/mnt/win_disk# set up mount points in the/mnt directory
Mount-t ntfs/dev/sda6/mnt/win_disk# Mount Sda6 to/mnt/win_disk unmount/mnt/win_disk# uninstall hard drive 5. System Command

uname-a | Uname-r # View kernel/operating system/CPU information
LSB_RELEASE-A # View System version information
Hostname # View Computer name
Cat/proc/cpuinfo # View CPU Information
Cat/proc/meminfo # View CPU Information
passwd # Modify User password
Reboot #重启
Shutdown #关机
Top dynamic monitoring of CPU, memory usage
Uptime # View System run time, number of users, load

chmod
-rw-r--r--(R (Read) W (write) x (executable)) 10 locations, each file or directory has three sets of access rights, each of which is represented by three digits, respectively, for the file owner's read, write, and execute permissions, and read, write, and execute permissions for users who are in the same group as the owner The read, write, and execute permissions of other users in the system. )
//1. Add file permissions to all user groups chmod A+x file (a represents all x)
//2. Simultaneously modify different user rights (file owner (u) to increase write permissions; add write permission to the same group of users as the file owner (g); other User (O) Delete execution permissions )
//chmod ug+w,o-x file
//3. delete Files permission #chmod a-x file

number setting method
//r=4,w=2,x=1   #chmod 751 file 


the composition of Linux

The general system consists of: core, Shell (command interpreter), the application Linux kernel consists mainly of 5 subsystems, such as process scheduling (SCHED), memory Management (MM), virtual file system (VFS), network Interface (NET) and interprocess communication (IPC).

File directory

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.