Review summary of Linux commands learning

Source: Internet
Author: User
Tags clear screen parent directory syslog zookeeper disk usage sonatype

1 、-------------------------Linux system Introduction -------------------------------------------------------

Linux unix operating system, is a multi-user, multi-tasking, multi-threaded and multi operating system. It can run the main unix tools software, Applications and network protocols. It supports 32 64 linux inherited unix with the network as the core design idea, is a stable performance of multi-user network operating system.

Linux appeared in 1991 , was developed by the Finnish University of Helsinki students Linus Torvalds and later joined by many enthusiasts to complete the joint development

The penguins are the iconic animals of Antarctica, and according to international conventions, Antarctica is common to all humankind and not to any country in the world today, and no country today has the right to include Antarctica in its territory.

Linux chooses Penguin logo as the symbol, the implication is also that: Open source Linux, for all the common all, any company does not have the right to private.

2 、---------------------common commands for Linux------------------------------------------------

(1) ls view files and folders.

To view files that contain hidden files: [[email protected] ~]# ls-a

Check the asking price for your details: [[email protected] ~]# ls-l or ll (lowercase l)

(2) Clear Screen Command

Clear or Ctrl+l shortcut keys

(3) Directory Jump

CD: [[email protected] ~]# CD apache-tomcat-7.0.61/

Return to Parent directory: CD.

(4) View your current location

Pwd

such as: [[email protected] apache-tomcat-7.0.61]# pwd
/root/apache-tomcat-7.0.61

(5) Create a directory

mkdir House

[Email protected] ~]# mkdir House

Total 54132
-RW-------. 1 root root anaconda-ks.cfg
Drwxr-xr-x root root 4096 Mar 14:46 apache-activemq-5.12.0
-rw-r--r--1 root root 46560868 apache-activemq-5.12.0-bin.tar.gz
Drwxr-xr-x 9 root root 4096 Nov 14:03 apache-tomcat-7.0.61
-rw-r--r--1 root root 8816567 Apr apache-tomcat-nexus-7.0.61.tar.gz
Drwxr-xr-x 3 root root 4096 Nov 9 17:42 data
drwxr-xr-x 2 root root 4096 Apr 7 14:50 House
Drwxr-xr-x 3 root root 4096 IK Analyzer 2012ff_hf1
-rw-r--r--1 root root 8836 install.log
-rw-r--r--. 1 root root 3384 may Install.log.syslog
Drwxr-xr-x 3 root root 4096 Nov 14:07 sonatype-work
Drwxr-xr-x 4096 June zookeeper-3.4.6

Create a cascading directory

Mkdir-p HOUSE1/HOUSE2/HOUSE3

[Email protected] house]# mkdir-p HOUSE1/HOUSE2/HOUSE3
[email protected] house]# LL
Total 4
Drwxr-xr-x 3 root root 4096 Apr 7 14:52 house1
[Email protected] house]# CD HOUSE1
[email protected] house1]# LL
Total 4
Drwxr-xr-x 3 root root 4096 Apr 7 14:52 House2
[Email protected] house1]# CD HOUSE2
[email protected] house2]# LL
Total 4
Drwxr-xr-x 2 root root 4096 Apr 7 14:52 house3
[Email protected] house2]# CD HOUSE3
[email protected] house3]# LL
Total 0
[Email protected] house3]#

(6) Delete directory, file

Rm-r House3-r means recursion

[Email protected] house2]# rm-r HOUSE3
Rm:remove directory ' House3 '? Y
[email protected] house2]# LL
Total 0

RM-RF House2-f forced to delete, after deletion there is no recycle Bin, can not find.

[Email protected] house1]# RM-RF House2
[email protected] house1]# LL
Total 0
[Email protected] house1]#

(7) Copy Directory

Cp-r House1/root-r indicates that recursion is generally required for a folder. Touch

[Email protected] house]# cp-r house1/root
[Email protected] house]# Cd/root
[email protected] ~]# LL
Total 54136
-RW-------. 1 root root anaconda-ks.cfg
Drwxr-xr-x root root 4096 Mar 14:46 apache-activemq-5.12.0
-rw-r--r--1 root root 46560868 apache-activemq-5.12.0-bin.tar.gz
Drwxr-xr-x 9 root root 4096 Nov 14:03 apache-tomcat-7.0.61
-rw-r--r--1 root root 8816567 Apr apache-tomcat-nexus-7.0.61.tar.gz
Drwxr-xr-x 3 root root 4096 Nov 9 17:42 data
Drwxr-xr-x 3 root root 4096 Apr 7 14:52 House
Drwxr-xr-x 2 root root 4096 Apr 7 14:58 house1
Drwxr-xr-x 3 root root 4096 IK Analyzer 2012ff_hf1
-rw-r--r--1 root root 8836 install.log
-rw-r--r--. 1 root root 3384 may Install.log.syslog
Drwxr-xr-x 3 root root 4096 Nov 14:07 sonatype-work
Drwxr-xr-x 4096 June zookeeper-3.4.6

(8) Create a file

1) Touch List

[[email protected] house]# Touch list
[email protected] house]# LL
Total 4
Drwxr-xr-x 2 root root 4096 Apr 7 14:56 house1
-rw-r--r--1 root root 0 Apr 7 15:00 list

2) Echo 123>>num

3)VI or VIM + file name

[[Email protected] house]# VI AA

(9) View the contents of the beginning or the end of a piece of text

Head, tail View the contents of the beginning or end of the text

Head-n 5 A.log View the first 5 lines of the A.log file

(10) Turn off firewall--3 step execution

Service Iptables Status

Chkconfig iptables off

Chkconfig iptables--list

(11) Show the status of a process

PS shows the process status of the moment

-A shows all processes for all users

-U Displays the process in the order of the user name and start time

-X shows the process without control terminal

[[Email protected] house]# PS Aux|grep python
Root 21266 0.0 0.0 103304 888 pts/0 s+ 15:46 0:00 grep python

(12) Close Process--kill command

[[email protected] house]# kill 12434

[[email protected] house]# kill-9 process ID

(13) View disk usage

[[email protected] bin]# DF

Filesystem 1k-blocks used Available use% mounted on
/dev/sda3 38885832 2269980 34633852 7%/
Tmpfs 959216 0 959216 0%/dev/shm
/DEV/SDA1 194241 29435 154566 16%/boot

(16) Network Configuration

1) View IP address

[[email protected] bin]# ifconfig

Eth0 Link encap:ethernet HWaddr 00:0c:29:69:be:7d
inet addr:192.168.2.44 bcast:192.168.2.255 mask:255.255.255.0
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:6808993 errors:0 dropped:0 overruns:0 frame:0
TX packets:77455 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:626986810 (597.9 MiB) TX bytes:8345830 (7.9 MiB)

Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0
Up LOOPBACK RUNNING mtu:65536 metric:1
RX packets:31 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4938 (4.8 KiB) TX bytes:4938 (4.8 KiB)

(17) Backup Compression Command

Tar command

-C Create a parameter directive for a compressed file

-X unlocks parameter directives for a compressed file

-Z is required to compress with gzip

-V to display files during compression

-F Use file name, immediately after F to receive the file name

1) Unzip

[Email protected] house]# tar zxf house.tar.gz

2) Packaging

[Email protected] house]# TAR-ZCVF house.tar.gz house/

(18) Power off restart command

1) Shutdown system shutdown

-R restart immediately after shutdown

-H does not restart after shutting down the machine

For example Shutdown-r 5 5 minutes after reboot

2) Power off after halt shutdown

3) Reboot reboot

Review summary of Linux commands learning

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.