Commonly used linuxcaicai commands

Source: Internet
Author: User
Tags install perl nslookup
Linuxcaicai's Common commands-general Linux technology-Linux technology and application information. For more information, see the following. Linux caicai
Command to view the linux version
# Uname-
# Cat/proc/version
# Cat/etc/issue
# Cat // display file content, which is the same as viewing content with type in windows
# Man [such as ls, cat, cd, mv, rm, cp] // it means we don't understand it, or we forget to use man to view the parameters. Very useful
# Clear // clear screen
# Fdisk-l // view the hda partition of the hard disk
Online download and Installation
1. Install mysql 5.0.15
# Wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.15.tar.gz
# Tar zxvf mysql-5.0.15.tar
1. Install perl-DBI-1.41-1.i386.rpm
# Wget ftp: // 194.199.20.114/linux/PLD/c... DBI-1.41-1.i386.rpm
# Rpm-ivh perl-DBI-1.41-1.i386.rpm

Gcc, gcc-c ++, gcc-g77, glibc, glibc-devel. Which command is used to install these packages. Thanks rpm-qa | grep gcc is generally rpm-qa for rpm package | grep gcc rpm-qa | grep glibc
View port netstat-avnt
I use shutdown-h now and init 0 to shut down
After the test is completed, # chkconfig -- list | grep mysql
A: configure the NIC
Write to/etc/sysconfig (IP address will not be lost after restarting)
Cd/etc/sysconfig/network-scripts
Cp ifcfg-eth0 ifcfg-eth0: 1
Vi ifcfg-eth0: 1 where the changes are as follows
DEVICE = eth0: 1
BROADCAST = 211.131.4.255
HWADDR = MAC address of the NIC
IPADDR = 211.131.4.253
NETMASK = 255.255.255.0
NETWORK = 211.131.4.0
OnBOOT = yes
TYPE = Ethernet
Wq exit
The restart takes effect.
LINUX Password Change command
# Passwd User Name
# Setup
Service httpd restart
# Service mysqld start
If it is stopped, use:
# Service mysqld stop
Ps-A | grep mysql process has no results.

In linux, run the following command to decompress tar jxvf file name .tar.bz2
# Find-name file name (meaning searching for files .)
# Grep-l string (find the file content package file name)
# Rm-I file list (specified, deletion Prompt confirmation, Y execution started .)
# Mkdir directory (create directory)
# Rmdir directory (delete directory)
# Chmod 755 file name (Set permissions)
# Useradd User Name (Add User)
# Useradd-g group name username (add user-specified group)
# Userdel User Name (delete user)
# Ll-d/home (query whether the user exists)
# Userdel-r user name (delete a user and delete the working home directory at the same time)
# Groupadd user group (Add User Group)
# Groupdel user group (delete user group)
# Id-G user (display ID)
# Ps (process)
# Netstat (display the configured Interface)
# Nslookup (query DNS database user-level commands)
# Mv */home/wwwroot/phpadmin mobile
# Df // check the disk partition size (# df-h)
# Du // view the MB size of each file
# Top // display the system process and press "q" to exit
# Cal // calendar
# Kill // kill the process (for example, kill Pid Number)
# File // verify the file body (for example, file/root/install. log)
For example, if you want to copy the same file, the command is cp?
Cp filename-new
Run cmd:
Enter nslookup
DNS viewing is good
Rm -- help Delete help
Rm-fr delete file name
[This post was last edited by cainiao on]
Or httpd in etc
./Server/httpd/bin/httpd-k restart
Chkconfig -- help
# Chkconfig -- list [name] // view the port
Chkconfig -- add
Chkconfig -- del
Finger, check that there are several logs on to this linux
Ifconfig to check whether the transmission is normal and whether the packet is dropped
# Service vsftpd restart specify FTP server restart
(Ln-s) means connection: it is to run the local file in another file as a shortcut. The command is as follows:
Ln-s/server/zend/etc/php. ini/usr/local/lib/php. ini
At this time, restart the system and the test will show that the php. ini path is different./server/zend/etc/php. ini
Package files
Tar-zcvf huiq.tar.gz huiq
Cut
Mv hui1.tar.gz/home/hui/
Mv [CUT name] Save path: Enter ":" colon,
For example, set nu indicates the serial number.
For example,/root searches for characters with root text.

1.
Solve Chinese display garbled characters, remote login vi cannot be used normally
Modify the LANG variable value
Handling of Chinese display garbled characters
Modify/etc/php. ini
Add or remove the following comments.
Default_charset = "gb2312"
Modify/etc/httpd/conf/httpd. conf at the same time
Modify this parameter
Adddefacharcharset gb2312
# Locale // view the language. If the server is garbled and available, enter the language command to be applied in the list.
1. Temporary Modification
# LANG = "zh_CN.gb2312"
Ii. Permanent modification
Modify the LANG value in the/etc/sysconfig/i18n file to zh_CN.gb2312, that is
LANG = "zh_CN.gb2312"
The restart takes effect.

Prohibit root users from logging on to the server through ssh.
# Vi/etc/ssh/sshd_config
PermitRootLogin no
./Scripts/mysql_install_db-user = mysql &
#./Scripts/mysql_install_db-user = mysql & initialize the database



Appears: [root @ localhost openssl-0.9.8e] # ln-sv/usr/local/ssl/lib/libssl. so.0.9.8/usr/lib/libssl. so
Create symbolic link '/usr/lib/libssl. so' to '/usr/local/ssl/lib/libssl. so.0.9.8'
The connection is complete.

Another Restart Method of httpd:
/Usr/local/apache/bin/apachectl restart

/Var/www/extsuite/extmail/html

1.there is a skill in windows. rarto choose to compress the file into a. ZIP file to facilitate the decompression in linux.
The following is the zip compression and decompression method used in linux.
Zip and unzip
To use zip to compress the file, enter the following command at the shell prompt:
Zip-r filename.zip filesdir

In this example, filename.zip represents the file you created, and filesdir represents the directory where you want to place the new zip file. The-r option specifies that you want to recursively include all files included in the filesdir directory.
To extract the content of a zip file, type the following command:
Unzip filename.zip

/Home/wwwroot/846net/wwwroot/bbs/sq_zzhyjy/var/lib/mysql/sq_zzhyjy

2. if the data is too big to be compressed by zip, it can only be compressed by rar.
Rar software is in the/home/wwwroot/rar folder.
Compressed package in/home/wwwroot/wwwroot.rar
Decompression method:./unrar x/home/wwwroot/wwwroot.rar
After decompression, copy the file to its folder. Note the folder permissions.
Download:
Use the compressed or decompressed rarfile in linuxto install rarlinux. download rarlinux-3.7.0.tar.gz from the rar Website: tar-zxvf xxx.tar.gz
The most common
Compression:
Rar a file name *. jpg: compress all jpg files to file name .rar.
Decompress:
Unrar l file name .rar view the file directory in the compressed package
Unrar e file name. rar decompress all files under the current directory (the original directories of all files disappear and are completely mixed together. If there is a duplicate name, the system will prompt renaming or overwriting );
Unrar x file name. rar parse each file according to the original directory relationship of each file in rar
Related Article

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.