Summary of common linux commands

Source: Internet
Author: User
Tags tmp folder

1. Linux directory Operation Command------ Directory addition, deletion, modification, and query ------Cd, Pwd, ls, mkdir, mv, ls (du, df,Tree)Switch directory, similar to the use of windows, the detailed information of the cd display directory is ls-ld, which is directly switched to the root directory cd/create the oracle directory mkdir/export lels-ld/oracledrwxr-xr-x 2 root under the root directory root 4096 Jun 21/oracle create multiple directories at a time mkdir-p/u01/app/oracle show the path of the current folder pwd When deleting the oracle directory show confirm rm-r/oracle Delete oracle when the directory is not displayed, confirm rm-rf/oracle to change the oracle directory name to oracle1mv/oracle oracle1 move the oracle directory to the/tmp directory mv/oracle/tmp to display the details of a directory ls oracle-ld view disk space df-h df/tmp display the structure tree/tmp of the tmp directory in the tree form view the path of all files in the tmp folder du/tmp copy files to a directory cp source dest2Linux File Operation commands------ File addition, deletion, modification, and query ------Touch, Cat, more, less, tail, head, rm-f, mv, cp,ViCreate the test text file touch testvi to open the file mode, and display the line number command: set number view the content of the test document cat test view the content of the test document the first 10 lines head-10 test view the content of the test document the last 10 lines tail-10 test network login Local Machine ssh localhost Real-Time monitor the logon information. tail-f/var/log/messagestail-f/var/log/secure displays the test text on the page, press space key to display the next page, press q to exit more test page to display the test text content, press Space key to display the next page, and press q to exit, press the up/down key to flip down the less testtest file and rename it to test1mv test test1. Move the test file to the mv test file in the upper-level directory .. /move the above-level file test to the current directory mv .. /test. copy test1 to test2cp test1 test2 copy one directory to another directory cp-r hh dd Delete test1 file and prompt whether to delete rm test1 force Delete test1 file rm-f test1 Delete the current directory all files rm-rf * back up a file cp test. bak3Common Methods for. vi File OperationsView Mode: G (shift + g) jumps to the end of the file. gg jumps to the header of the file./search for a text starting from the end of the text? Search for a text dd from the beginning of the text delete a line ndd Delete multiple lines yy copy a line nyy copy multiple lines p paste one or more lines u undo the previous operation colon mode: w save: wq save and exit: x save and exit: q! Do not save and exit: wq! Force save and exit: set number display row number editing mode: Insert after a current character I Current Position insert o current row after append a new line after insert different modes switch between ESC4. Linux users and group operationsId oracle view User Information cd/home ls-acat/etc/passwdcat/etc/shodawuseradd oracle create oracle user useradd-u 501 oracle useradd-u 501-g root oracleuseradd-h view useradd the command briefly helps man useradd to view Detailed Help of the useradd command, open the Help file directly, q exit usermod-u 502 oracle modify user information usermod-g root oracleuserdel-r oracle Delete oracle user passwd oracle modify user password cat/etc/group view group information groupadd-g 501 dba add group info groupdel dba Delete group, if there are users in the group, delete the giduseradd-u 502-g oinstall-g dba Of The groupmod-G 501 dba Modification Group. oracle adds multiple groups to the user, su-oracle switches users, and switches user configuration files. su oracle switch user, but do not switch user configuration file permissions set r w x4 2 1rwx r-x r-xuser group others 7 5 5 root otherschwn oracle: oinstall/oracle modify a directory permission chown-R oracle: oinstall/oracle modify a directory and its sub-directory permissions ls-ld/oracle view directory permissions chmod-R 777/oracle set the directory to the maximum permission chmod-R 755/oracle modify the oracle directory and its sub-Directory Permissions is 7555Install and decompress linux software, yumFile a.tar.gz *. tartar-xvf a.tar cvf a.tar a/* .tar.gz tar-zcvf a.tar.gz atar-zxvf a.tar.gz *. gzgunzip a.gz gzip-6 a.gz *. bz2tar-jxvf a.bz2 tar-cjvf a.bz2 *. cpiocpio-idmv <. cpio * .cpio.gz zcat a.cpio.gz | cpio-idmv *. zipunzip a.zip install software rpm-ivh file. rpm filters installed software rpm-qa | grep zsh uninstall software rpm-e file. el5 view so installed software rpm-ga use yum to install software mount/dev/hdc/mntcp rhel-debuginfo.repo rhel5.repovi rhel5.repoyum configure [server] name = serverbaseurl = file: // mnt/serverenabled = 1 gpgcheck = 0 gpgkey = file: /// etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release refresh yum configuration source yum clean all use yum Installation Software yum install gcc *-yyum groupinstall6Linux host name, network configuration, and network viewSetup #################################### name eth0Device eth0Use DHCP [] Static IP 192.168.12.100Netmask 255.255.255.0Default gateway IP 192.168.12.1 ########################### ######## restart the NIC/etc/init. d/network restart view network configuration information ifconfig ethoifconfig-aip add manually modify the network configuration file vi/etc/sysconfig/network-scripts
######################################## ####################### Inter Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE = eth0BOOTPROTO = noneHWADDR = 00: 0c: 29: 9e: 72: f4ONBOOT = yesTYPE = ethernetmask = 255.255.255.0IPADDR = 192.168.12.100GATEWAY = 192.168.12.1
######################################## ###################### Modify the host domain name vi/etc/hosts
######################################## ######### 127.0.0.1 localhost. localdomain localhost :: 1 localhost6.localdomain6 localhost6192.168.91.10 RHL5 #################################### ##############
Vi/etc/sysconfig/network
####################### NETWORKING = yesNETWORKING_IPV6 = noHOSTNAME = RHL5GATEWAY = 192.168.91.1
###################### Immediately refresh system settings su-manually modify the domain name hostname RHL5 and exit the terminal, re-enable check whether the IP address is successfully set ping 192.168.12.100 check whether the domain name is successfully set ping RHL57. Linux disk management, storage configuration command (raw configuration), multi-path Software ConfigurationView the information of each partition fdisk-l enter the partition mode fdisk/dev/sda to make the partition operation take effect immediately partprobe format a partition mkfs. ext3/dev/sda5 mount the partition to a directory before using the mount/dev/sda5/mnt partition to cancel the mount operation umount/dev/sda5 to map the partition to a bare device, add the dba permission cd/etc/udev/rules. dvi 60-raw.rules ###################################### ################## ACTION = "add ", KERNEL = "sda5", RUN + = "/bin/raw/raw1% N" KERNEL = "raw *", OWNER = "oracle" GROUP = "dba ", MODE = "0660 "################################### #################### start_udevraw-qacat 60-raw.rules8. Oracle required parameter configurationGlobal process, thread configuration/etc/profile ########################### if [$ USER = 'oracle ']; then ulimit-u 16384 ulimit-n 65536fi ######################### switch from su-oracle to oracle user cd/oracle switch to the oracle directory to modify oracle user environment variables. bash_profile ####################################### ######### export ORACLE_BASE =/oracle/app/oracleexport ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/dbexport PATH = $ ORACLE_HOME/bin; $ PATH ###################################### ########## network parameter configuration/etc/sysctl. conf ####################################### ############################## Kernel sysctl configuration file for Red Hat Linux # # For binary values, 0 is disabled, 1 is enabled. see sysctl (8) and # sysctl. conf (5) for more details. # Controls IP packet forwardingnet. ipv4.ip _ forward = 0 # Controls source route verificationnet. ipv4.conf. default. rp_filter = 1 # Do not accept source routingnet. ipv4.conf. default. accept_source_route = 0 # Controls the System Request debugging functionality of the kernelkernel. sysrq = 0 # Controls whether core dumps will append the PID to the core filename # Useful for debugging multi-threaded applicationskernel. core_uses_pid = 1 ##################################### ################################# process and thread configuration/etc /security/limits. conf ################################### oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 ############################ #######9Graphical support required for oracle InstallationXManagerVNCxShellputty10. ssh basic operationsSsh restart/etc/init. d/sshd restartssh login to remote machine ssh 192.168.21.100 copy files to a remote host directory scp-r/oracle 192.168.12.100:/tmp11. linux optimized commandsTerminate the specified process kill-9 11024 terminate the xxx process kill-9 'ps-ef | grep xxx | grep-v grep | awk '{print $2} ''ps-ef | grep ora _ view process df-h view disk space free-m view memory vmstat 1 5 view system statistics (including cpu, mem, io, etc.) top Command s to adjust the refresh frequency, for example, change to 1, shift + P sort by CPU shift + M sort by memory shift + T sort by Time shift + U filter by user

 

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.