Linux Foundation use

Source: Internet
Author: User
Tags readable zip folder

--linux Combat--1


Support multi-threaded./Multi-user
Good security
Superior in memory and file management

Linux minimum only needs 4m--"using embedded development

--Command
Wildcard characters
* represents multiple letters or numbers
? Represents a letter or a number
[1-6] stands for 1-6 between

\ escape Character

StartX into the graphical interface
Shutdown-h now immediately shuts down the machine
Shutdown-r now reboot
Reboot restart

SU Switch User


Logout user logoff


Use of the--vi editor
1 ...
VI Hello.java
I--Enter Insert edit mode
Enter ESC key "Enter Command mode"
Enter:--there are two options
Wq means to exit the deposit report
Q! Exit does not save


LS--View the files in the current directory
Ls-l--View file details
Ls-a--View hidden directory information


The Linux file system is a hierarchical, tree-like directory structure in which
The top level is with the directory '/'

CD/--Switch directory with CD/To go to the root directory
DIR--it's almost like LS, it's a real-life catalogue.

Linux Important directory results see 1-1....USR directory is the default installer directory map does not.


PWD-which path is displayed.


Useradd--Adding users
passwd--Set password
Userdel--Delete user
Userdel-r--Delete the user and the user's home directory

init [0123456]--Command initialization mode
Linux Run Level
0: Turn off the machine
1: Single User
2: Multi-user status No NETWORK service
3: Network Service with multi-user status
4: System not used reserved to user
5: Graphical interface
6: System restart
Common RunLevel is 3 and 5 to modify the default run level modifiable files
/etc/inittab Id:5:initdefault: The number in this line is the first one to be read in this file
/etc/rc.d/rd.sysinit--System initialization script
/etc/rc.d/rcx.d/[ks]*--Configure services based on RunLevel X
Termination of services beginning with ' K '
Start a service that begins with ' S '
/etc/rc.d/rc.local--Perform local special configuration


.... If you change it to 6 or 0 in the go-to interface,
/etc/inittab no content in Ubuntu
When entering the Grub boot interface, enter the E
Enter E in the second row selected
Enter 1 "Single User Level" at the end
----------------------------never tried-------------.

PWD--Show working directory
LS--List files and directories
Ls-a Show hidden files
Ls-l Display long list format
Ls-al


mkdir--Building a directory
RmDir--Delete empty directory
Tounch--Create an empty file
CP--Copy command
CP-RF--Copy


MV--Moving files and changing file names
RM--Delete files and directories
RM-RF *--Delete all content including directory and file R recursive F mandatory
LN--Establishing symbolic connections
Ln-s Source Target
Ln-s/etc/inittab Inittab
--inittab point to Time file/etc/inittab


More--Displays the contents of the file with pagination
Less-Displays the contents of the file with pagination
Grep --Query keywords in text
| --pipe command--give the result of the above command |
After the command is processed
The man--man command is equivalent to a DOS command
Find--Search for files and directories
Find/-name Files--Starting from the root directory
FIND/HOME-AMIN-10:--Files or directories accessed within 10 minutes
FIND/HOME-ATIME-10:--Files or directories accessed within 10 hours
FIND/HOME-CMIN-10:--changed files or directories within 10 minutes
FIND/HOME-CTIME-10:--Changed files or directories 10 hours ago


Find/home-size +10k--Find the file size of 10k in the/home directory File


REDIRECT Command
> File--The pipe-directed command indicates that the results of the search on the > left are written to
The right side of the file does not have to be created there on the overlay. (Overwrite write)
>> file--the same command as above except that the file does not overwrite only append (append write)

Each user of Linux must belong to a group


Ls-ahl--View file owner

Adding groups to Linux
Groupadd Policeman


Vi/etc/group--VI command can see the file can also change the file
Cat/etc/group--Cat only view commands that are not modified

Create a user and specify which group to assign the user to
USERADD-G Group name User name
Modify the group that the user resides in
USERMOD-G Group name User name


Change the initial directory of user logins
usermod-d Directory name User name


View all user information in Linux
vi/etc/passwd
cat/etc/passwd


The permissions are divided into three types: R is readable with 4, W can be written with 2, and X is represented by 1.


When viewing the file information, the following paragraph indicates
-rw-r--r--


Divided into four segments-,rwx-,r--, r--
-Indicates file type D (directory) L (link)
The owner of the rwx-file has permission to the file
The user of the group that the rw--file is in to change the file's permissions Ho
r--the permissions of the other group's users on the file



command to change permissions gives ABC permission
chmod changing the permissions of a file or directory
chmod 755 ABC:RWXR-XR-XR
chmod U=RWX,G=RX,O=RX ABC: Same as u= user rights, g= group permissions 0= Different other groups other user rights
chmod u-x,g+w ABC: for ABC to remove user-executed permissions, increase group Write permissions
chmod a+r ABC: Add read permissions to all users
--Change owner (chown) and user Group (CHGRP) commands
CHGRP Group name File name--to modify the group in which the file is located
Chown User name File name--to modify the owner of the file
Chown user name./directory Name--to modify the owner of the directory
Chown-r user name./directory Name--to modify the directory and all files below it And the owner of the directory


JDK Installation Steps/
1. Mount the Mypackage.iso on the Linux operating system
Configure the VM well
Mount/mnt/cdrom--Use this command to mount in a directory with
Umont/mnt/cdrom--Unmount the optical drive
2. Copy the installation file to/home because the ISO optical drive file is not readable when installing Will write something that will cause unsuccessful
CP File/home--Copy command



3. Cd/home Switch to home directory

4../???. Bin Enter ...


5. Look at a file/etc/profile "Environment profile"


6. Configure your own installed JDK files
Java_home =/.....
Path= $PATH:/...
classpath=.:/ ......
Export Java_home PATH CLASSPATH



Eclipse installation is the same
TAR-ZXVF???. tar.gz Installing tar.gz files

Launch Eclipse "into the GUI"


Ctrl+alt+t entering the terminal


./green File startup-Some files do not support this start only in the graphical interface
Enter terminal to hit this command to start



MyEclipse must be installed under the graphical interface


Tomcat installation Ibid.


---"Partition
DF--View Linux system partition status
-H more detailed partitioning case
-L


Fdisk-l


=======>


The Shell under Linux
--All commands must be interpreted by the shell parser as executable code for re-delivery Executed to the Linux kernel.
--shell can also be programmed
There are three types of shells in the following directory
/bin/sh
/bin/csh
/bin/bsh


= = "
View the currently used shell
ENV--Use this command to view the environment configuration
Chsh-s/bin/csh---Modify the shell


Alias usage to command aliases
Example: Ls-l/Home
Alias Llh:alias llh = ' ls-l/home '


Compression and decompression using zip and unzip


Compress files
Zip aa.zip file name
Zip aa.zip file name 1, file name 2
Zip-r Aa.zip Folder
Zip-m aa.zip file After compression is complete delete the original file
Zip-y aa.zip file does not compress linked files


Gzip and gunzip process. gz files


Unzip the file
Unzip Aa.zip


History 5--This description shows the 5 most recently used commands
!5--This description executes a command with a history number of 5
!ls--This description executes the last command that starts with "LS"


= = "
TCP/IP Basics
TCP/IP protocol consists of (TCP,IP,UDP,ARP,RARP and other protocols)
See Figure 1-2


Application Layer
Transport Layer
IP layer
Link Layer


Ping IP--desperately making
Tracert IP--View track routing for stitching Networks
Traceroute
Ifconfig--The following command to view the IP condition is that Windows is ipconfig
Ifconfig eth0 down-Disable device eth0
Ifconfig eth0 up--turn on the device eth0


Turn off firewalls in Linux (set with Setup command channel text mode)
--for network configuration to take effect use the following statement
/etc/rc.d/init.d/network restart




In Linux, all the devices are files.
===> Configuring the Network
1 .....
Setup--Permanent modification
/etc/rc.d/init.d/network Restart to take effect on network configuration


2 ...
Ifconfig eth0 IP Address
---This configures the network to take effect immediately, but is temporary.




3 ...
Modify/etc/sysconfig/network-scripts/ifcfg-eth0
Each property in this file can be modified, including IP, subnet mask, broadcast address
, default gateway: is permanently modified
/etc/rc.d/init.d/network Restart to take effect on network configuration




Device=eth0--Device name
Onboot=yes--Boot up or not
BOOTPROTO=DBCP--DBCP delegates automatically assign IP staic to represent themselves Fixed IP

= = = "
RPM Management Redhat Package Manager
Example: apache-1.3.23-11.i386.rpm
= "RPM Common commands
RPM-QA--Query which RPM software is installed in Linux
RPM-Q Package Name Section
Rpm-i RPM Package Full path name---Install package to current system
RPM-IVH RPM Package Full path name---Install package to current system there are hints and progress bars
i = Install
v = verbose
H = Hash


RPM-E RPM Package Full path name--delete RPM package
RPM-E--nodeps RPM Package Full path name--Force Delete RPM Package
Rpm-u RPM Package Full path name--RPM package upgrade





= = = "
Samba Server---for Windows and Linux file sharing


Installation steps for Samba
1.. see if Samba is already installed
Rpm-q Samba
2. Uninstall if available
Rpm-e Samba
3. Attach your own installed files to Linux
4. Copy the Samba installation file to the/home directory for installation
5: Start the installation
Rpm-i Samba Installation rpm file
6: Create a user useradd xx ...
7: Add a user who uses Samba
cat/etc/passwd | mksmbpasswd.sh >/ETC/SAMBA/SABPASSWD
8.. Set Samba Password
SMBPASSWD Users
9: Start Samba server, test
Service SMB Start---Start the SMB service
Service SMB Stop---Stop the SMB service
Service SMB Restart---Restart SMB service

10: IP used in Windows to access//linux after starting Samba
Access to files that are shared in Linux



= = = "
Set Task Dispatch command crontab
1 ...
CRONTAB-E--setting tasks


2 ...
Perform date >/home/mydata1 at certain intervals
Hopefully, 2:00 every day to execute date >>/home/mydata2
--CRONTAB-E Add 0 2 * * Date >>/home/mydata2
---0 2 * * * with a table for the time of day of the week


3. How to schedule multiple tasks
1. In crontab-e, continue to write.
2 ... can put all the tasks, write to an executable file (Shell programming)


Conrtab-r--Terminating a task






= = = "
Monitoring network status information
Process.
Process is the program that is being executed
Thread
A lightweight process
The process has a separate address space. Thread does not have
A thread cannot exist independently, it is created by a process.
Relatively speaking, threads consume CPU, and memory is less than process




The PS command is used to see what is currently being performed in the system. And the state of their execution.
1..ps-a--Displays all process information for the current terminal
2..ps-u--Display process information in user's format
3..ps-x--Show background process run parameters
Pa-aux--A comprehensive view and comprehensive information




Kill process PID Number--Terminate process
KILL-9 process PID number--Forced termination process
Killlall process PID Number--Delete the process and all child processes


Top is very similar to the PS command. They are all used to show the process being executed.
The biggest difference between top and PS. Is that top performs a period of time to update a running process
1. Monitor specific users
Top: Enter this command. View the process of execution
U: Then enter u return and enter user name to monitor specific user


2. Terminating the specified process
top--"Enter--" K--"Enter--" Process ID number


Tip-d---Specifies the time for the system update process to be 10 seconds.




14:06:22 up 4 MIN, 1 user,load average:0.02,0.12,0.07
--4 min Represents how long the system started 1 user users
--load average:0.02,0.12,0.07 Current system load condition if/3>0.6 Represents system usage greater than 60%
Panax Notoginseng processes:36 sleeping,1 running,0 Zombie, O stopped
--37 processes: Number of processes sleeping: number of sleeps 1 running run
0 Zombie Zombie Process number of useless processes but it takes up memory.
0 stopped stop Count
Cpu states:0.0% User 0.1% system 0.0% Nice 0.0% inwait 99.8% idle
--CPU usage 99.8% Idle represents how many CPUs are idle
mem:255264k av, 39428k used,215836k free, 0 shrd, 5528k Buff
--Memory usage used free idle in use
swap:257032k av, 0k used, 257032k free
--Virtual memory usage


Date-Displays the system time mmddhhmmccyy. SS month, day and day are divided annually. seconds seconds


Cal 3 2002--View the March 2002 calendar


Cal 2008--View the 2008 calendar


Netstat--Network information
Netstat-an--Detect host Connection command ping:



= = = "
MySQL database usage under Linux
Groupadd MySQL
useradd-g MySQL MySQL
CD mysql--enter MySQL to execute the following sentence
scripts/mysql_install_db--user=mysql
Chown-r Root. (Modify the owner of the file)
Chown-r MySQL data (modifies the owner of the date folder)
Chgrp-r MySQL. (change user group)
Start MySQL
Bin/mysqld_safe---user =mysql & "& means to start at a later stage"
Check it out.


The following command is executed under the mSQL Bin directory
CD bin
./mysql-u Root-p


Backup mysqldump-u root-p Password database name > Data.bak
Recovery: mysql-u root-p Password database name < Data.bak
Look at the structure of the table--desc


User environment variable Configuration root/home/user/.bash_profile Add path
/.BASHRC startup files When a user logs on
System environment variable Configuration/etc/profile
/etc/bashrc



Pay special attention to MySQL drive to store the location under the JDK.
/jre/lib/ext/


= = = "
Use of SSH (Secure shell)








= = = "
Installation and configuration of FTP






= = = "
Network programming under Linux




1 ... how to use Linux


2 ...


3 ...


4 ...





















































Linux Foundation use

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.