Linux-initial entry

Source: Internet
Author: User
Tags ssh secure shell
Red Hat Linux

# Add a user
Useradd Username
# Set Password
Passwd Username
# Deleting a user
Userdel Username
Userdel-r username # delete a user and the user's home directory
# Modify the incorrect configuration at startup
Press e when you select a startup Item.
Select a startup Item and press E
Grep "keyword" aaa.txt # search for files containing this keyword
Grep-n "keyword" aaa.txt # search for files containing this keyword
Grep "keyword" aaa.txt/home/# search for files containing this keyword
Grep "keyword" aaa.txt/home/* # search for files containing this keyword
Find/-name xxx.txt # search for xxx.txt from the/directory
Ls-Ahl # file owner
Groupadd groupname # Add a user group
VI/etc/group #
CAT/etc/group | more
Useradd-G groupname Username
CAT/etc/passwd
Usermod-G groupname username # change the user group
Mount/mnt/CDROM/# mount the Optical Area
Umount/mnt/CDROM/# uninstall the Optical Area
/Etc/profile # environment configuration file
Tar-zxvf xxx.tar.gz # Installation
Fdisk-L # view partitions
/Dev/sda1
Device Name-> scaci-disk-A: First disk-1: First Partition
DF/boot/
Mount/dev/sad1/test/# mount the previous device to the test directory
Umount/test/
DF # partition usage
DF-H

/Boot partition 100 m
Two times the memory of swap partition, not greater than 256 m
/Root partition as large as possible
Samba # share files with win
Linux and Unix shell programming guide
EVN # Display System Environment Variables
CHSH-S/bin/CSH # select shell interpreter
Man mkdir #
History
History 5 # view the five most recently used commands
! 5 # This command indicates that the execution history is 5.
! Ls # Run the last command starting with LS
TCP/IP details
# Network Environment Settings
Setup
Ifconfig
#/Etc/sysconfig/network script/ifcfg eth0
/Etc/rc. d/init. d/network restart # make the network configuration take effect
Ifconfig eth0 192.168.88.88 # temporarily valid
Ifconfig
Rpm-Qa # query installed RPM packages
Rpm-Q MySQL #
Complete rpm-I RPM package path
Rpm-ivh rpm package # I: Install V: verbose H: Hash
Rpm-e JDK # delete an RPM package
Rpm-u RPM package full path
Rpm-e -- nodeps Samba # force uninstall and ignore lazy relationships
# Install samba
Rpm-IVH samba-common-
Rpm-IVH samba-client-
Rpm-IVH samba-x.x.x-
Useradd youyou
Passwd-> youyou
# Set Samba password for youyou
CAT/etc/passwd | mksmbpasswd SH>/etc/sambapasswd
Smbpasswd youyou

Service SMB start
# Service SMB stop
# Service SMB restart
# Access \ IP under Win to read and write
#/Etc/crontab Task Scheduling
Crontab-e
# Minute (0-59) hour (0-23) date (day of month, 1-31) month (0-12) Week (0-6)
* *** Date>/date. log # indicates that this command is executed every minute.
# Call a shell
VI/root/task. Sh
Chmod 744/root/task. Sh # Grant executable permissions to the file
Crontab-e
* ***/Root/task. Sh
Crontab-R # Clear all tasks
Crontab-L # list all tasks
# Process: a running program
# Thread:
1. Lightweight Process
2. The process has an independent address space and the thread does not
3. purebred objects cannot exist independently. They are created by processes.
4. Relatively speaking, the CPU and memory consumed by the thread is smaller than the process
#
PS-A # display all processes of the current terminal
PS-u # display process information in user format
PS-X # display parameters of background processes
PS-Aux #
Kill pid # Kill the process
Kill-9 pid # force kill Process
Killall pid # Kill processes and sub-Processes
Top # dynamic monitoring process --> [Baidu]
Load average: 0.02, 0.12, 0.07 # sum divided by 3. If the result is greater than 0.6, the system load is heavy.
Top-D 10 # refresh once every 10 seconds
# Enter U and then root to view the root user's process.
Cal 4 2002
Cal 2002
Netstat # displays network statistics
Netstat-ANP #-P: displays the process number
Tracerroute #
# Install MySQL
Tar-zxvf file.tar.gz # Installation
Groupadd MySQL
Useradd-G MySQL
# Enter the MySQL folder directory
Scripts/mysql_install_db -- user = MySQL # initialize the database
Chown-r root. # change all files and directories in the MySQL directory
Chown-r Mysql Data # modify the data folder owner so that MySQL can write data
Chgrp-r mysql. # change the user group to MySQL.
# Start MySQL
Bin/mysqld_safe -- user = MySQL &
/Username/. bash_profile # user environment variable
Mysqldump-u root-ppassword Database Name> data. Bak # backup database
Mysql-u root-ppassword database name <data. Bak # restore

Find/home-name ABC # search for files by file name in the directory
Find/home-Amin-10 minutes of memory files/Directories
Find/home-atime-memory retrieved in 10 hours
Find/home-Cmin-changed in 10 minutes
Find/home-ctime + changed 10 hours ago
Find/home-size + 10 k search for files 10 in the directory

Ln-S source target # establish link
CP-r aa/BB/#-r recursion,
Rm-RF xxx/

Zip aaa.zip
Zip aa.zip file name 1, file name 2 # compress the two files to aa.zip
Unzip zz.zip
Unzip aa.zip-X file. C # decompress the file. c file

# Java Network Programming

#. The bashrc file is executed after the user logs in and can store the user startup items

Jspghost.exe

SSH Secure Shell -- Download

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.