Linux finishing basic operation command

Linux Basic Operations

This chapter is continuously updated according to the degree of learning perfect! ! ! (Update Frequency: This tentative update every two weeks to update !!! refueling)

1, Linux basic operations

File operations:

1, display files

ls: Displays the files and directories in the current directory

ls -a: shows all files and directories in the current directory, including hidden files and directories.

ls -l: Displays detailed information about the current directory under the file directory box.

ls -h: displays the size of the files and directories in the current directory to the appropriate units

ls -alh or ls -a -l -h: regardless of order three longitudinal

Example: ls / bin: Check the root directory bin folder of all content;

2, Jump directory

cd: Open a folder path or folder name followed by folder

cd -: Jump to the last operation, only to jump back and forth between the last two steps.

cd ~: Jump to the home directory of the current path, e.g. / home / hadoop

pwd: displays the current absolute path

cd ..: Jump to the current path on the layer

.: Indicates that the current path

..: a layer of the current path

../../ ..: three on the current path

2, file search

grep: search for content from the file.

grep -n 't': all display contents with 't' of the case-insensitive, line numbers

Common shortcut keys:

1, practical operation command

CTRL + C: Canceled

Cntrl + D: Interrupt

clear: Clears the current screen, but will move on the current page content, not deleted.

Tab: an input for auto-completion

touch: create a file in the current folder, Linux does not form the file name suffixes, for example, test.txt just a file name.

\: The backslash escape character. Display cases ls * a * a folder of files and directories

| (Pipe): Connect two commands. Example ls -alh | more

cat: view the contents of the file, if the file is more content, use the mouse to see the ball, swept away.

cat filename> File name: the implementation will copy the contents of a file to another file

cat multiple file name> File name: Implement merge multiple files.

cat / etc / motd: the login prompt:

[22:57:21 root@centos8[ ~]#  cat  /etc/motd
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        佛祖保佑    iii    永不死机

[22:57:23 root@centos8[ ~]#

cat / etc / issue: see text file

cat / proc / cpuinfo: Like lscpu query the current device CPU, but displays a more detailed

[23:01:33 root@centos8[ ~]#
[23:01:34 root@centos8[ ~]#lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  2
Socket(s):           2
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               158
Model name:          Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Stepping:            10
CPU MHz:             2592.001
BogoMIPS:            5184.00
Hypervisor vendor:   VMware
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            12288K
NUMA node0 CPU(s):   0-3
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xsaves arat flush_l1d arch_capabilities
[23:01:35 root@centos8[ ~]#cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 158
model name	: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping	: 10
microcode	: 0xaa
cpu MHz		: 2592.001
cache size	: 12288 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xsaves arat flush_l1d arch_capabilities
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 5184.00
clflush size	: 64
cache_alignment	: 64
address sizes	: 43 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 158
model name	: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping	: 10
microcode	: 0xaa
cpu MHz		: 2592.001
cache size	: 12288 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xsaves arat flush_l1d arch_capabilities
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 5184.00
clflush size	: 64
cache_alignment	: 64
address sizes	: 43 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 158
model name	: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping	: 10
microcode	: 0xaa
cpu MHz		: 2592.001
cache size	: 12288 KB
physical id	: 1
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xsaves arat flush_l1d arch_capabilities
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 5184.00
clflush size	: 64
cache_alignment	: 64
address sizes	: 43 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 158
model name	: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping	: 10
microcode	: 0xaa
cpu MHz		: 2592.001
cache size	: 12288 KB
physical id	: 1
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xsaves arat flush_l1d arch_capabilities
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 5184.00
clflush size	: 64
cache_alignment	: 64
address sizes	: 43 bits physical, 48 bits virtual
power management:

[23:01:42 root@centos8[ ~]#

2, help documentation

history: history enter the command

--help: Help Documentation

ls -help: View the ls command help

man ls: ls command interpreter View

man bash: You can view all the internal commands integrated in the shell by entering the command man bash

which: View command position, for example, which ls: ls command to view the location where the

3, view the date

uptime: displaying server uptime

date: display the current time (ntp: Network Time Protocol)

date [MMDDhhmm [[yy] ss]]: Output Formatting

date '+% Y-% m': Output Formatting

4, process control

ps: View process information, equivalent to the Task Manager

ps -aux: Display all running programs

-a: shows all processes on the terminal

Detailed status display process: -u

-x: display process without a controlling terminal

-w: Display widened to display more information

-r: displays only an ongoing process

top: dynamic display process

m: Memory, c: CPU, etc. can be sorted by the first letter of the attribute

5, shutdown and restart

reboot: reboot

shutdown -r now: immediately restart

shutdown -h now: immediately shut down

shutdown -h 20:35: eight thirty-five shutdown

shutdown -h +10: after ten hours off

init 0: Shutdown

init 3: After you log console command line mode

init 5: After you log in GUI mode graphics

init 6: Restart

df: check the current disk case

du: displays the size and path of all files in the current directory

du -h: displays the file size of the unit

6, calculator:

bc: binary conversion, input bc enter, enter the transport obase = 2, converting the digital input, which is binary conversion, ibase = 8, octal conversion is:

[22:47:59 root@centos8[ ~]#bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
obase=2
25
11001
obase=8
25566
10101101110110
^C
(interrupt) Exiting bc.
[22:48:49 root@centos8[ ~]#

Character command:

: The same function with source)

"": You can identify variables, does not recognize the command

'': Variable and commands are not recognized as a character string are

``: Variables and commands are recognized and the single quotation marks, and will reverse the contents of the original single quote command is executed, then the command to call the reverse single quotes to continue

\: You can achieve translation (the original meaning is not the end of the command)

$ (): Variable

{}: Equivalent to ``

Guess you like

Origin www.cnblogs.com/Coolcoc/p/12549187.html