linux下ifconfig、shutdown等命令无法使用_开启Shell命令
来源:互联网 发布:greenplum数据库编码 编辑:程序博客网 时间:2024/05/27 06:55
有些时候不能用一些命令,是因为权限问题。
su root 和 su - root的区别
su root切换成root用户权限,但是环境变量不是root的环境变量。
su - root切换成root用户本身,环境变量和权限都是root用户的,没有区别。
为什么在 RedHat Linux 5 下不能使用 ifconfig 命令
我安装完 RedHat Linux 5 之后,在终端使用一些命令,如: ifcinfig 查看本机的IP,发现不能使用此命令,提示说“command not found”,这该怎么办呢?想想肯定是环境变量没有加载,那就动手修改一下环境变量,修改如下:
www.2cto.com
1、初始安装完成系统之后,系统为了更加安全,有些命令的路径没有在PATH环境变量中,可以用echo $PATH命令查询得知,添加路径到PATH环境变量的方法如下:
(如添加/sbin到PATH环境变量中)
(1)如果只想在本次开机过程中临时性的添加修改,下次开机就无效的话,可以:
输入export PATH=$PATH:/sbin
(2)如果只给当前用户永久添加,则:
在~/.bash_profile中的靠近末尾有类似这样的一行PATH=$PATH:$HOME/bin后添加:/sbin,就变成PATH=$PATH:$HOME/bin:/sbin
文件修改并保持完以后,运行source ~/.bash_profile命令即可使修改操作立即生效。
(3)如果给系统中所有的用户都永久添加,则:
在/etc/profile文件末尾添加export PATH=$PATH:/sbin
文件修改并保持完以后,运行source etc/profile命令即可使修改操作立即生效。
2、还有一种解决的办法
[root@admin007]# /sbin/ifconfig
或者修改 /etc/profile 文件
[root@amdin007]# vi /etc/profile
把下面if 语句注释掉
# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi www.2cto.com
修改为:
# Path manipulation
#if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
#fi
保存,重新启动系统!
系统启动好之后,试试在终端使用命令,看看有没有生效吧。
设置linux启动level
Java代码 www.2cto.com
/proc中的重要信息
cat /proc/cpuinfo - CPU (i.e. vendor, Mhz, flags like mmx)
cat /proc/interrupts - 中断
cat /proc/ioports - 设备IO端口
cat /proc/meminfo - 内存信息(i.e. mem used, free, swap size)
cat /proc/partitions - 所有设备的所有分区
cat /proc/pci - PCI设备的信息
cat /proc/swaps - 所有Swap分区的信息
cat /proc/version - Linux的版本号
www.2cto.com
# 0 - halt (Do NOT set initdefault to this) 关机(不要设置为默认)
# 1 - Single user mode 单用户模式
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) 多用户模式,但不支持NFS
# 3 - Full multiuser mode 完全的多用户模式
# 4 - unused 没用到
# 5 - X11 图形界面
# 6 - reboot (Do NOT set initdefault to this) 重启(不要设置为默认)
RedHat中要改变启动级别,只要修改/etc/inittab,找到其中的 id:?:initialization 这行,这里?就是[0-6],如果你要从图形界面启动就为5,如果你要从字符界面启动就[1-3]。
转自:http://www.2cto.com/os/201207/140660.html
转自:http://www.2cto.com/os/201207/140660.html
0 0
- linux下ifconfig、shutdown等命令无法使用_开启Shell命令
- linux下ifconfig、shutdown等命令无法使用_开启Shell命令
- linux下ifconfig、shutdown等命令无法使用_开启Shell命令
- 解决Linux下ifconfig、shutdown等Shell命令不能使用的问题
- ifconfig 等不命令无法使用
- Linux shell 命令 -- route, ifconfig
- linux无法执行ifconfig命令
- Linux下使用shutdown命令关闭系统
- Linux下找不到IFCONFIG命令---ifconfig
- Linux shell命令无法使用
- 解决CentOS7下使用ifconfig命令无法查看inet地址
- Linux下找不到IFCONFIG命令
- Linux 下找不到ifconfig命令
- linux 环境下使用shutdown.sh命令无法关闭tomcat 进程
- Linux下shutdown命令详解
- Linux下shutdown命令详解
- linux ifconfig命令使用详解
- linux命令---ifconfig命令
- 厄拉多塞筛法
- Bluemix云平台实践:注册试用
- java中获取路径中的空格处理(%20)问题
- yii2学习笔记(八)设置默认布局文件
- android的模拟器定制
- linux下ifconfig、shutdown等命令无法使用_开启Shell命令
- CKEditor扩展插件:自动排版功能
- poj 动态规划DP - 2392 Space Elevator
- Java基础学习总结——Java对象的序列化和反序列化
- SQL Server中的Merge关键字
- jsp request 对象详解
- 英文字母和中文汉字在不同字符集编码下的字节数
- 【iOS学习笔记】远程推送
- UITableView删除的时候崩溃NSScanner:nil string argument