Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Common basic commands and Primary Network configuration methods in linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "linux common basic commands and primary network configuration methods". In daily operation, I believe many people have doubts about linux common basic commands and primary network configuration methods. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "linux common basic commands and primary network configuration methods". Next, please follow the editor to study!

Basic command

Uname-a-s

Hostname displays hostname

If you want to take effect permanently, edit the following files

# vim / etc/sysconfig/network

Ssh remote login

# ssh 10.1.1.54 (logged in as root)

# ssh tom@10.1.1.54 (login as tom)

# ssh-Y 10.1.1.54 (can start remote login with graphical interface)

Scp remote copy

# scp 10.1.1.54:/etc/passwd / tmp/test (copy the / etc/passwd file at the destination address 10.1.1.54 to the local / tmp/test)

# scp / tmp/test 10.1.1.54:/etc/passwd (contrary to the above)

-r can copy folders

File View File Properties

# file passwd

Init

Configuration file / init/inittab

Level 0 shutdown

1 single user mode, which is mainly used to change the administrator password

2 text mode without network support

3 text mode with network support

4 retention

5 graphical interface mode

6 restart

Sync synchronization data

Synchronize data that has not been synchronized to disk to disk (usually data in memory)

Shutdown

-r restart

-p turn off the power directly

-h 14.09 "hurry up,the system is shutting down"

-c cancel the shutdown plan

Firefox &

Start the Firefox Liuhammer in the background

[root@dns 03] # jobs

[1]-Running gedit ule_02.txt &

[2] + Running firefox &

[root@dns 03] # fg 1

Transfer the job---gedit ule_02.txt that is still running in the background to the foreground

Ctrl + z puts the foreground process in the background and pauses

Bg runs a process paused in the background.

Ctrl + c ends a foreground process

Date date command

# date+%x

03/17/2010

# date +% m/%d/%y

03/17/2010

# date +% Y-%m-%d

2010-03-17

# date "+% Y-%m-%d% H:%M:%S"

2010-03-17 14:26:45

# date 031714282010

Month, day, hour and year "- revision time

# echo $(($(date +% s) / 86400)) calculates the number of days from the current distance of 1970 Muhami 01

# echo $($(date-- date='2010-03-18 00VOV 00VANG 00' +% s) / 86400)

Echo $LANG to view the current locale

Export LANG=en_US.UTF-8 changes the locale

Network configuration

Network card configuration

# ifconfig

Ifconfig eth0

Eth0 Link encap:Ethernet HWaddr 00:25:86:91:3D:34

Inet addr:10.1.1.72 Bcast:10.1.1.255 Mask:255.255.254.0

Inet6 addr: fe80::225:86ff:fe91:3d34/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:

RX packets:51873478 errors:0 dropped:0 overruns:0 frame:0

TX packets:51390710 errors:0 dropped:0 overruns:0 carrier:0

Collisions:0 txqueuelen:1000

RX bytes:747618634 (712.9 MiB) TX bytes:3903334584 (3.6GiB)

Interrupt:177 Base address:0xac00

Configure subinterfaces (temporarily effective)

# ifconfig eth0:1

# mii-tool

Check whether the network card link is up.

Modify the configuration file of the network card

# vim / etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report