linux命令大全
来源:互联网 发布:百分百邮件营销软件 编辑:程序博客网 时间:2024/06/04 18:00
1)、cat file |grep “b”查找file文件中包含b的行
2)、cat file |grep -E “`b” 查找file文件中以b开头的行
3)、cat file |grep -i “b”查找file文件中包含b的行,不区分大小写
4)、cat file |grep -v “b”查找file文件中不包含b的文件(相当于取反)
5)、grep “b”file 查找当前目录的file文件中包含b的行
6)、grep -v “b” file (v取反,不包含b的行)
18、man 查找命令的帮助信息
1)、man ls
19、info 类似于man
20、命令 --help 获取帮助信息,与18、19类似 ls --help
21、文件的压缩,常用的压缩文件:.gz、 .bz2、
1).gz(-v 显示详细的压缩过程,-c显示详细信息,-f指定压缩后的文件名,-z打包同时压缩)
tar czf file.tar.gz file.txt 压缩文件,保存原文件
tar xzf file.tar.gz 解压文件,保存原文件
2).bz2
tar cjf file.tar.bz2 file.txt 压缩文件,保存原文件
tar xjf file.tar.bz2 解压文件,保存原文件
3).gzip
gzip file.txt 压缩文件 形成新文件file.gz,原文件删除
gunzip file.gz 解压缩文件,原文件删除
4).zip
zip file.zip file.txt 压缩打包,原文件删除
unzip file.zip 解压,原文件删除
22、wall 向所有用户广播
1)、wall aaaaa
23、ping(-c 指定发送次数,-s 指定数据包的大小)
24、ifconfig 查看和设置网卡信息。root用户才能执行
1)ifconfig
2)ifconfig eth0 192.168.3.2 设置网址
25、关机 init 0/shutdown(shutdown -h now 立刻重启)
重启 init 6/reboot(reboot -f 立刻关闭所有程序,重启,会丢失数据)
init 3 字符界面
init 5 图形界面
26、file 文件名 查看文件属性
============================================================================ 27、查看iptables防火墙
iptables -L 没有安全策略,证明防火墙关闭
iptables -F 关闭防火墙,再执行保存操作,service iptables save
28、SElinux防火墙
查看SElinux防火墙 :sestatus,结果如下为关闭
SELinux status: disabled
若开着进入 vi /etc/selinux/config
============================================
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled(更改这里)
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
=============================================
29、/etc/passwd 存储用户信息,7个字段
/etc/group 存储用户组信息
/etc/shadow 存储用户密码信息(!!代表用户没有密码,*代表用户被禁用)
30、添加用户 useradd
删除用户 userdel
设置密码 passwd
31、pwd 显示当前的路径
33、usermod
禁用一个用户 usermod -L username
启用一个用户 usermod -U username
34、目录结构
bin:普通用户可以用的二进制的可执行程序
sbin:一些重要的 给root用户来用的
proc:一般是内存中的抽空
mnt:一般是空的,media
lib:一些库文件
etc:一般都是配制文
补充
35、查看file.txt头10行 head file.txt 或者head -n file
查看file.txt尾10行 tail file.txt 或者tail -n file
修改目录/dir及其目录下文件为所有用户具有的全部权限 chmod -R 777 /dir
36、cal显示当月的日历,uptime显示系统从开机到现在所运行的时间
w显示登录的用户
whoami查看你当前用户名echo $USER
df -h显示磁盘占用情况
du -h 显示目录空间占用情况
free 显示内存及交换区占用情况
37、df (-h ,-T)查看分区情况,-h转换存储容量单位,-T显示文件格式
38、du -sh 查看目录的大小
39、mount 挂载光盘 例如 mount /dev/hdc /media 将光盘挂载到media目录下
umount 卸载光盘 umount /dev/hdc或者 umount /media
40、yum常用参数
yum list 查看光盘源内容
yum install 安装软件 yum -y install 全自动安装
yum -y install 包名 --skip-broken
41、linux字符浏览器elinks
elinks http://192.168.255.1 【--dump】【--source】
按q键退出
42、elinks常用操作:
elinks http://192.168.255.1 --dump
#查看网站代码
elinks http://192.168.255.1 --source
#查看网页源代码
43、查看cat more head 前10行 tail后10行
tail -2 test 后2行
tail -f test.txt实时跟踪test.txt文件
44、useradd
userdel 删除不了user的家目录信息
userdel -r user1 删除user1的所有信息和文件
45、who 查看系统当前在线用户.
46、stat file 查看文件file的详细信息
47、free -m 以m为单位显示内存
- Linux 命令大全
- Linux命令大全
- Linux命令大全(ZT)
- Linux命令大全(ZT)
- linux命令大全
- linux命令大全
- Linux命令大全
- linux网络命令大全
- LINUX命令大全
- redhat Linux命令大全
- linux命令大全
- linux命令大全
- linux网络命令大全
- ubuntu linux 命令大全
- linux命令大全
- LINUX命令大全
- linux命令大全
- linux命令大全
- bzoj 3738: [Ontak2013]Kapitał 数论
- linux
- hdu 1269 迷宫城堡 Tarjan算法
- CSS display 属性
- sqlite、mysql和postgresql对比
- linux命令大全
- 内部类详解
- Ubuntu14.04+Texlive2014+LYX-Linux下LYX的中文配置方案
- Android线程池
- 蛇形填数
- 常用正则表达式 备忘
- Visual Studio Visual C++
- uva156
- 【LeetCode】LeetCode——第12题:Integer to Roman