Installation of the Linux operating system and detailed instructions for basic operational commands

Source: Internet
Author: User
Tags clear screen directory create file copy solr

Background: Using a virtual machine to install a Linux virtual machine using a VMware Linux version: centos-6.7-x86 self-Download: Centos-6.7-x86_64-bin-dvd1.iso

Open VMware-FILE-"New Virtual machine-" Select typical-Next-"Select the third install later-next-" Select Linux-Next-"Virtual machine name, location, take it yourself-next-" Set the disk size, but not too small, the next choice to split multiple-next Step-"Click on custom Hardware, the size of the memory to see their own size settings, the new CD/DVD (IDE) This connection settings using the ISO image file, find you" Centos-6.7-x86_64-bin-dvd1.iso "this place. Network adapter, select Bridge, Nat is also possible. Then close,-click Done

Click Open this virtual machine, select the first one, then jump out, select Skip, finally select Next, (in the bottom right corner of the page), the language can choose Chinese Simplified, the keyboard choose American English, Next, there is a network configuration, click in, double-click the first system eth0 Automatic connection to the tick and then click on the application, the host name, you can start, the password set at random, as long as they remember to live, and then the next step is OK.

Linux Operations Command
One, the operation of the file or folder
Cd.. Exit level
CD/push to the root directory
CD plus file name go to Next level directory
Ll-a view all files including hidden files
Ll-h can view the size specific more KB
Cat file name View the contents of a file
More file name space next page
Less file name PgUp previous page PgDn next page
CP File/catalog file copy one file CP 1.txt 2.txt CP 1.txt A/3.txt
Cp-r tomcat1 TOMCAT2 Copy the contents of the TOMCAT1 into the TOMCAT2
No need to add r when copying individual files
CP Solr-4.10.3/dist/solr-4.10.3.war/usr/local/solr/tomcat/wabapps/solr.war
The representative means to copy a war packet under solr-4.10.3 to the specified file directory and rename it to Solr.war
Cp-r Apach-tomcat.7/usr/local/solr/tomcat//When copying a folder, add R to indicate that the iteration will copy TOMCAT7 to the specified folder and rename to Tomcat
PWD View your current location
mkdir Create a new folder
Mkdir-p A/B/C Creating multiple directories
RmDir Delete a folder note must be an empty folder
VI and VIM create a new file if it is not created if you have to edit it
Create a file Touch file name
Then press I to enter the edit state
After editing, press ESC to exit if you edited press: +wq Q (You did not change) q! (You can force quit if you don't want to save)
Move file MV file directory/filename
Renaming the MV file with a new file name

Iterative-R

RM Delete If not asked directly delete rm-f 3.txt (delete 3.txt directly)
RM file with ask for delete
Deletion of Rm-r iterations
RM-RF iterative deletion without asking
Second, packaging or decompression (☆)
Tar package files or unzip a file
TAR-VRF Package a file or directory
TAR-ZCVF packaging a file or directory compression format gzip
TAR-XVF unzip or open a tar file
TAR-ZVF Unzip a tar file
Package all files in the current directory
TAR-CVF Test1.tar./*
Package all files in the current directory into the current directory
TAR-ACVF test1.tar.gz Test2.tar./*
Extract the Tes1.tar to the current directory
TAR-XVF Test1.tar
Unzip the Test1.tar to the specified folder
TAR-XVF test1.tar-c/user/local/
Third, find the eligible string (☆☆☆)
grep string
wget + Download Resource path (download file)
Four, will often use later
Find and Java-related processes
PS Aux|grep Redis
Ps-ef | grep java
PS-EF View All Processes
Find 3306 related processes
Ps-ef | grep 3306
V. System-Related Settings
1. Setting the system time
Date to view the current time of the system
Date-s "2017-5-30 23:22:30" time to set up the system
2. View the size of the disk
Df-h Formatting View
3. View Memory usage
Free-m
4. Presentation process
Top
5. Clear Screen Ctrl+l
6.kill-9 + Kill a process to force kill a process (☆)
Ifconfig nic name up: Enable NIC
8. View Port is occupied
Netstat-an | grep 3306 7.ifconfig nic name down: Disable NIC

Vi. User creation and authorization
Useradd + Name
passwd + Password

Useradd + user name-d/home/directory create a user and then specify the user's home directory

Delete
Userdel + user name only remove user not to delete home directory
Userdel-r User name Delete all

Switch users
Ssh-1-User name-P 22 (port)
Assigning Permissions to Files
Format: chmod [who] [+ | - | =] [mode] filename?
chmod +x start-all.sh;


Vii. Supplementary
1../serve. ./+ executable file to start a program
For example:./redis-cil
2. Search for the word/+ to search in the file
such as/deam
Next n
3. Turn the firewall on or off
Service Iptables Stop/start
4. Enquiry
Rpm-qa |grep Java (fuzzy query) Red Hat Package Manager
5. Delete a file
Yum-y Remove + delete MySQL or Java files
6. installation files
The Java file
Yum List |grep java
Yum Install +jdk file
Info Replication (View details of the current node)
Eight, install JDK MySQL Tomcat
Yum Install glibc.i686
Make the configured file effective immediately
Source/etc/profile
RPM-E--nodeps Delete MySQL or Java files

Tail-f catalina.out (Dynamic view log file)

After you start Tomcat, you can view the console, print the log
Tail-f Logs/catalina.out
To view the status used by a port
: Netstat-tunpl|grep 6379

Installation of the Linux operating system and detailed instructions for basic operational commands

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.