solaris查看操作系统位数
使用isainfo -v
命令
如果是运行在32位模式下,
则有如下输出: 32-bit sparc applications
如果是运行在64位模式下,
则有如下输出: 64-bit sparcv9 applications 32-bit sparc applications
solaris查看操作系统
有下面三种方法:showrev、uname和查看/etc/release。
redhat64:
close fireware
[automation@automation Desktop]
sudo[automation@automationDesktop]
su -
[root@automation ~]# iptables -F
永久关闭关防火墙:chkconfig iptables off,使用这个命令时,先关闭防火墙才行。
service iptables save
service iptables stop
chkconfig iptables off
作者为了配置防火墙,寻找iptables服务不得,直到某一刻! 才发现,我用的是CentOS 7.0,而这个版本的防火墙,默认使用的是firewall,与之前的版本使用iptables是不一样的,这点很重要!
所以如果要配置防火墙,开启端口的话,可以用如下做法:
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
查看防火墙状态:systemctl | grep firewalld
//查看RedHat版本
cat /etc/redhat-release
//查看ip
ifconfig -a
//linux scp远程拷贝文件及文件夹
1、拷贝本机/home/administrator/test整个目录至远程主机192.168.1.100的/root目录下
scp -r /home/administrator/test/ root@192.168.1.100:/root/
2、拷贝单个文件至远程主机
scp /home/administrator/Desktop/old/driver/test/test.txt root@192.168.1.100:/root/
其实上传文件和文件夹区别就在参数 -r, 跟cp, rm的参数使用差不多, 文件夹多个 -r
3、远程文件/文件夹下载
举例,把192.168.62.10上面的/root/文件夹,下载到本地的/home/administrator/Desktop/new/下,使用远程端的root登陆
scp -r root@192.168.62.10:/root/ /home/administrator/Desktop/new/
Ubantu:
ps aux | grep slave
杀掉进程:kill -9 进程号
切换到超级用户:sudo -s -H
修改文件为可执行权限:chmod +x filename 某个路径下的所有文件chmod +x ./*
让所有用户对某个文件夹有读写可执行权限: chmod 777 -R flodername
执行文件时:./filename
ubuntu下查看电脑配置:
1. 查看cpu
~
cat/proc/cpuinfo2.查看内存占用
cat /proc/meminfo
- 硬盘分区
$ cat /proc/partitions - ubuntu 版本
cat /proc/version
或者
cat /proc/version_signature
uname -a
结果: Linux tal-qa-dataprep 3.13.0-79-generic #123-Ubuntu SMP Fri Feb 19 14:27:58 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cat/etc/issue
结果:Ubuntu 14.04.4 LTS \n \l
ubuntu查看service,跟win7里的manage->services一样的命令是 ls /ect/init.d
1. 查看系统中的软连接,比如:find /usr/lib -type l|xargs ls -l ;
2. 删除系统中的软连接:rm -rf symbolic_name 注意不是rm -rf symbolic_name/
执行jar包:java -jar XXX.jar
查看端口是否被占用:
用root用户:netstat -anp | grep port
进一步使用命令:ps -aux | grep pid 查看具体被占用进程的信息
lsof -i:port
wc命令可以对文件中的行数、字符数、字节数进行计数
wc -l fileName
ubuntu下显示文件中某几行
1、cat命令
如:显示file_name 中的 第200至240行 命令有两个方案可选: “` cat file_name | head -n 240 | tail -n 40 cat file_name | tail -n +200 |head -n 40 “` 注: 1)head -n 240 意思是显示0至240行; 2)tail -n 40,意思是显示末尾40行内容,两者组合即可显示200至240行内容; 3)tail -n +200:从200行开始显示,显示200行以后至尾行的内容;
2、sed命令
[plain]
sed -n '5,10p' file_name
这样就可以只只显示第5行到第10行内容