Linux common commands 3

find /root/ -type f -name "test1.txt"|xargs cat xargs Process delete commands
one by one after the previous results : find /root/data -type f -exec rm -f {} \; find + path + "-type" +type+"-exec" +processing+find results{}\; find /root/data/ -type f|xargs rm -f find /data -type f ! -name "b.txt "|xargs rm only keeps the b.txt file, and deletes the rest. Find /data -type f ! -name "b.txt" finds all other files that do not contain b.txt [! Negative /Negative] alias unalias yum rpm seq xargs grep echo tail !+ historical execution command number to directly execute the command (get the command number from history) rpm -qa openssh openssl openssl-1.0.1e-57.el6.x86_64 openssh -5.3p1-123.el6_9.x86_64











SSH is a security protocol for remote login sessions and other network services.
Two incompatible versions of SSH [SSHv1] [SSHv2]

Telnet protocol 23 to
view the process: ps -ef
to view the port: netstat -lntup to
view the configured IP: ifconfig / ip add
ss -lntup|grep ssh ? ? ?
netstat -lntup|grep ssh? ? ?
ps -ef|grep ssh? ? ?
telnet +ip + port number example [telnet 192.168.153.128 22]

cat /etc/redhat-release version
uname -r kernel
uname -m check 32-bit or 64-bit
uname -n
hostname hostname hostname
who am i username

Linux interacts with windows files
yum install lrzsz -y
yum install telnet lrzsz nmap dos2unix -y
rz -y transfer files to linux (select the file after typing the command) -y overwrite the
sz -y file name to download the file in linux to the local - y cover

useradd username
passwd username
tail -1 /etc/passwd
tail -1 /etc/group
tail -1/etc/shadow
env |grep username View the user's user information under the current user/view environment variables
echo $PS1 View Environment variable
PS1="[\u@\h \W \t]\$" Display time [root@centOS6 ~ 16:05:56]$

Use the full path "/bin/cp" or "\cp" to skip the prompt
alias to find the current alias
unalias to cancel the alias

alias ly="echo i am liyang"
ly
i am liyang
.bashrc Store personalized aliases or paths
~ user's home directory

 

Configure the network card
cat /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0 [onboot = yes]
ifup eth0
/etc/init.d/network restart
setup If garbled characters appear, LANG = en
ifconfig View configuration
ping ip -t

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324761351&siteId=291194637