linux常用命令

pwd                                                                             [显示当前的所在目录]
ls /                                                                               [显示根目录内容]
useradd                                                                      [添加用户]
passwd                                                                       [设置用户密码]
ls /home                                                                     [显示home目录下的帐户文件夹]
ls -ld /home/用户名 
ls -a
                                                                            
su -                                                                             [切换到超级用户登录]
ls -l /                                                                           [显示根目录的属性]
login                                                                           [切换登录用户]
df                                                                               [显示硬盘信息]
du -sh/*
fdisk -l /dev/hda
hdparm  /dev/hda                                                      [显示hda硬盘的性能选项]
hdparm -d1 /dev/hda                                                 [打开hda硬盘的DMA特性]

more /etc/rc.local                                                       [查看系统初始化的脚本文件]

 

网络相关命令:
more /etc/resolv.conf                                                 [显示本机的DNS配置]
ifconfig                                                                      [显示本机所有网卡的信息]
netconfig                                                                   [调出网络配置图形界面向导]
service network restart                                             [重启网络服务]
route -n                                                                    [显示路由表]
ping -b 192.168.1.255                                              [发送广播给192.168.1.0网段的所有主机]
ifconfig eth0 192.168.1.2 netmask 255.255.255.0   [配置eth0口的IP信息]
route add default gw 192.168.1.254                           [添加默认路由到192.168.1.254]
ls  /etc/sysconfig/network-scripts/              
cat /etc/sysconfig/network-scripts/ifcfg-eth0    
vi  /etc/sysconfig/network-scripts/ifcfg-eth0                 [可以用vi编辑ifcfg-eth0文件来修改IP]

netconfig || neat                                                          [把/etc/sysconfig/network-scripts目录下的文件复制给/etc/sysconfig/networking/profiles目录.如果使用过图形界面配置过网卡信息,则会保存在networking profiles下面,系统优先调用networking/profiles下的文件,那么network-scripts下的文件则不会被调用。通过使用netconfig || neat 命令则可以保证2个目录的内容一致.]

redhat-config-network-tui                                          [图形界面配置,相当于使用neat,发现在RedHat Linux AS 4.0下无法使用这个命令]

locale                                                                       [显示系统的语言]
locale -a                                                                  [显示所有语言]
LANG=zh_CH.gb2312                                             [显示中文文字]
LANG=en_US.UTF-8                                               [显示英文文字]

more /etc/sysconfig/hwconf                                     [查看硬件配置]
 
service kudzu start                                                  [检查新硬件,适用新增设备的时候使用]
chkconfig kudzu --list                                              [显示kudzu运行级别]
setup                                                 [运行 验证服务器,防火墙,鼠标,网络,系统服务等图形界面向导]
chkconfig --list | more
chkconfig rsync on                            [修改/etc/xinetd.d下的rsync状态]
chkconfig rsync --list
service xinetd restart                         [运行/etc/xinetd.d脚本]
ls -ld /etc/rc?.d  

runlevel                                            [查看系统当前运行级别]
chkconfig sshd --list                         [查看ssh服务的运行级别状态]
more /etc/inittab                               [查看inittab文件内容,可以通过vi命令来修改系统运行级别]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值