cetnos basic information and ssh

------------ ------------ restore content begins

cetnos basic information and ssh

A: centos linux system command basic information: **

1. Check the linux version
[root @ Test02 ~] # CAT / etc / RedHat-Release
CentOS Linux Release 7.1.1503 (Core)
2. View cpu info
[root @ Test02 ~] # CAT / proc / cpuinfo
3. Check linux memory size
[root @ test02 ~] # cat / proc / meminfo | grep MemTotal # View the amount of memory
MemTotal: 1,884,696 kB
[root @ Test02 ~] #cat / proc / meminfo | grep MemFree # View the amount of memory free
MemFree: 1162524 kB
4. List loadable kernel modules
[the root Test02 @ ~] # the lsmod
5. the view system uptime, the number of users, cpu load
[the root Test02 @ ~] # uptime
01:34:43 up 3:02, user. 1, load Average: 0.00, 0.01, 0.04
6. The view all processes
[the root Test02 @ ~] # PS -ef
7. The user information specified view
[the root Test02 @ ~] # the root ID
UID = 0 (the root) GID = 0 (the root) group = 0 (root)

two:

Common Functions:

1. Log
SSH -p22 [email protected]
2. Direct Run -> best full path
SSH [email protected] -ltr LS / Backup / Data
==> SSH [email protected] / bin / LS - LTR / Backup / the Data
3. view known hosts
CAT /root/.ssh/known_hosts
4.ssh remotely execute sudo command
ssh -t [email protected] sudo rsync hosts / etc /

Common ssh command parameters:

[-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-i identity_file] [-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]

End ------------ ------------ restore content

Guess you like

Origin www.cnblogs.com/yyhyht117/p/12048306.html