最近的学习的linux命令笔记
vmstat 2 2
mail -s nihao root < test.txt f 323 h 300-310
crontab -l,-e,-r vim /etc/crontab
iptables -A INPUT -p tcp -m multiport --dports 22,80 -m state --state NEW,ESTABLISHED -
j ACCEPT
iptables -t nat -A PREROUTING -d 192.168.238.1 -p tcp --dport 80 -j DNAT --to-
destination 192.168.238.8:8080
iptables -P INPUT DROP -R -I -N -E -X -D -Z -F
iptables -A INPUT -p tcp --dport 80 -m iprange --src-range 172.16.100.5-172.16.100.10 -j DROP
ss -tn | grep "\<80\>" | wc -l
sed -n "1,3p" file sed '/\btest1\b/d' test echo "this is a test" | sed ‘s@\btest\b@abc@’
head -3 file
cut -c 1-4 /etc/passwd #取每行的前1-4个字符
cut -c -4 /etc/passwd #取每行的前4个字符
cut -c 4- /etc/passwd #取每行的第4个到最后字符
cut -c1 -4,5 /etc/passwd #取每行的1-4和第5个字符
cut -c 1 /etc/passwd
sort -n -r -k -t -u
uniq -u -c
lsof -i:80 lsof /mydata/data fuser -v MOUNT_POINT fuser -km MOUNT_POINT lsof -p 1708此进程打
开了哪些文件
sysctl -p /etc/sysctl.conf sysctl net.ipv4.ip_forward sysctl -w net.ipv4.ip_forward=1
rev test
grep -o -v -A -B -C -c -E -n -i
file /dev/tty5 | awk '{print $2}'
0 8-18 * * * rm -rf /abc/* &> /dev/null
tar -czf heihei.tar.gz heihei
/etc/sysconfig/network-scripts/ifcfg-eth0
useradd -g class01 std10 useradd -G class01 std01
last last -n 5
route add -net 10.0.0.0/8 gw 192.168.238.1 route add default gw 192.168.238.1
第一次握手,建立连接,客户端发送SYN包到服务器,并进入SYN_SEND状态,等待服务器确认;
第二次握手,服务器收到SYN,同时自己也发送一个SYN包和一个ACK包来确认客户端的SYN,并进入SYN_RECV;
第三次握手,客户端收到服务器发来的SYN+ACK后,回复服务器端一个ACK确认,发送完毕后,双方进入ESTABLISHED状态。
ping -c 10 -W 1 1.1.1.1
fsck -a /dev/sda1
ulimit -n ls -l /proc/35417/fd/ vim /etc/security/limits.conf
dd if=/dev/sda of=./mbr bs=1 count=512
tcpdump tcpdump -i eth1 src host 192.168.238.229 tcpdump -i eth1 dst host 192.168.238.229
tcpdump tcp port 80 tcpdump src host -c 1000 192.168.238.250 and dst 192.168.238.1
tcpdump host -c 1000 192.168.238.250 and src port 80 tcpdump -i eth3 -nnAs0 dst host 211.143.63.58
-A : 以ASCII码格式打印每个数据包(不包括链路层的数据头)。方便捕捉web页面
-nn : 不转换协议和端口号
cat /dev/urandom | head -1 | md5sum | cut -c 32 >> /pass
openssl rand -base64 30 | head -c -32 >> /pass
cat access.log | sort | uniq -c | sort -n -r | head -10
$RANDOM [0,32767]
iptables -A INPUT -p tcp --dport 80 -m limit --limit 1000/second -j ACCEPT
grep "\:[[:digit:]]\{1\}\:" /etc/inittab
> /dev/null 2>&1
find ~ -name "*rpm*"
find . -name "[A-Z]*"
find /var -user root -a -group mail -ls
find /usr -not -user root -a -not -user bin -ls
find /etc -mtime -7 -a -user root
find / \( -nouser -o -nogroup \) -atime -7 -ls
find /etc -size +1M -type f -exec ls -lh {} \;
find /etc -not -perm -001 -type f -ls
find /etc -perm /113 -type f -ls
find / -ctime +3 -name "*.log" -exec rm -f {} \;
MaxKeepAliveRequests为一次连接可以进行的HTTP请求的最大请求次数
sed -e 's@^#[[:space:]]*@@g' -e '/^UUID/d' fstab
update user set Password=Password('new') where User='root';
flush privileges;
skip-grant-tables
有一块移动硬盘,上面有300G数据,如何快速cp到linux服务器?
mount -t ntfs /dev/sdc1 /mnt/
运行这样一条命令:yum install ntfs-3g -y 我们的linux就支持对ntfs格式的U盘的读写了
partx -a [device] lspci | grep -i 'eth' ethtool eth0
POST-->BIOS(boot,sequence)-àMBR(bootloader,446) -àKernelàinitramfsà(Rootfs)init
awk '{print NR,NF,$1,$NF}' file echo "this is a test" | awk 'gsub(/test/,"abc")' (使用gsub如果一行匹配多个都替换)
awk '/^root/,/^mysql/' test----打印以正则表达式root开头的记录到以正则表达式mysql开头的记录范围内的所有记录。如果找到
一个新的正则表达式root开头的记 录,则继续打印直到下一个以正则表达式mysql开头的记录为止,或到文件末尾
comm -12 1sh 2.sh 注意比较的第一个文件要用sort先排序,这是找出1sh和2.sh相同的行 -3是找不同的行,--help查看命令帮助
最近的学习的linux命令笔记的更多相关文章
- N天学习一个Linux命令之帮助命令:man
前言 工作中每天都在使用常用的命令和非常用的命令,忘记了用法或者参数,都会bing一下,然后如此循环.一直没有真正的系统的深入的去了解命令的用法,我决定打破它.以前看到有人,每天学习一个linux命令 ...
- 常用Linux命令笔记
任何脱离业务的架构都是耍流氓 只记录实际常用的Linux命令 常用Linux命令 查找安装路径: whereis nginx 查询nginx进程: ps aux|grep nginx 查看 CentO ...
- 每天学习一个Linux命令-目录
在工作中总会零零散散使用到各种Linux命令,从今天开始详细的学习一下linux常用命令,坚持每天一个命令,学习的主要参考资料为: 1.竹子-博客(https://www.cnblogs.com/pe ...
- linux 命令笔记
linux 命令 创建目录 mkdir XX 列出目录 ls 进入目录 cd .. 进入上层目录 cd xx 进入xx目录 cd ~ 进入用户主目录 删除目录 rm -fr XX 清空目录,谨慎使用 ...
- Linux命令笔记(一)
vi 有三种模式,输入模式,编辑模式,“:”命令模式vi 进入以后默认是编辑模式vi 编辑模式默认的快捷键 上下左右分别是 J K H Lvi 在编辑模式使用 i 可以进入输入模式vi 输入模式只能输 ...
- N天学习一个Linux命令之free
用途 查看系统内存(物理/虚拟/缓存/共享)使用情况 用法 free [-b | -k | -m | -g | -h] [-o] [-s delay ] [-c count ] [-a] [-t] [ ...
- N天学习一个linux命令之ping
用途 检测主机是否可到达,也就是说,目标主机是否可以联网,还可以用于检测网速.通过发送ICMP ECHO_REQUEST数据包检测. 用法 ping [options] destination 常用选 ...
- N天学习一个linux命令之kill
用途 用于终止进程 用法 kill [-s signal|-p] [--] pid... kill -l [signal] 说明 1.默认发送信号15(请求终止进程,程序可以捕获,操作系统会杀死没有对 ...
- N天学习一个linux命令之du
用途 统计文件或者目录占用硬盘空间大小 用法 du [OPTION] [FILE]du [OPTION] --files0-from=F 常用参数 -a, --all统计所有文件,不仅仅是目录 -b, ...
随机推荐
- Delphi 线程的处理
http://www.cnblogs.com/doit8791/archive/2012/05/16/2502671.html
- using inno setup uninstall default icon
If you set SetupIconFile then the Uninstall Exe File (e.g. unins000.exe) will have exactly same icon ...
- [AFUI]App Framework
---------------------------------------------------------------------------------------------------- ...
- 【小错误】起归档是遇到ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
今天在起归档时遇到ORA-00265: instance recovery required, cannot set ARCHIVELOG mode的错误 从错误我们能够看到是由于datafile,c ...
- Select的深入应用(1)
在子句中使用列的位置: 使用select语句创建新表: 在子句中使用列的别名: 注意,你的 ANSI SQL 不允许你在一个WHERE子句中引用一个别名.这是因为在WHERE代码被执行时,列值还可能没 ...
- C++临时变量的生命周期
C++ 中的临时变量指的是那些由编译器根据需要在栈上产生的,没有名字的变量.主要的用途主要有两类: 1) 函数的返回值, 如: string proc() { return string(" ...
- 使用UI Automation实现自动化测试 --微软提供的控件Pattern
微软提供的控件Pattern System.Windows.Automation 命名空间 System.Windows.Automation.BasePattern 为控件模式类提供基实现 Syst ...
- Windows API学习---线程与内核对象的同步
前言 若干种内核对象,包括进程,线程和作业.可以将所有这些内核对象用于同步目的.对于线程同步来说,这些内核对象中的每种对象都可以说是处于已通知或未通知的状态之中.这种状态的切换是由Microsoft为 ...
- Ax Grid 的显示根据用户的需求动态排序。
点击方向按钮上下移动记录. 设计思路. 以临时表TmpTable1举例. 在表中加一个real类型字段(eg:ColumnSeq)用于排序,给表建一个ColumnSeq字段的索引ColumnSeqId ...
- asp.net常用字符串函数
/// <summary> /// 提取字符串中的数字 /// </summary> /// <param name="str"></pa ...