Linux安装后基本设置

来源:互联网 发布:社交网络英文 百度云 编辑:程序博客网 时间:2024/05/16 19:30
 
Linux安装后基本设置
命令
date               print or set the system date and time
pwd               return working directory name and print name of current/working directory
useradd          create a new user or update default new user information
passwd          update a user’s authentication[证明] tokens(s)[记号]
ls                   list directory contents
su                  run a shell with substitute[替代] user and group IDs
whoami          print effective[有效的] userid
exit                cause[引发] normal process termination
whatis            search the whatis database for complete words[命令的简介]
df                  report file system disk space usage[使用]
du                 estimate[估计,统计] file space usage
fdisk              分区管理工具
hdparm          get/set hard disk parameters[参数]
[命令]command –help          用来找命令的帮助
Ctrl+C            可强制中断程序运行
 
登录用户初始化文件为.bash_profile   .bashrc[见附录1]
登出用户执行文件为.bash_logout
 
根目录各目录作用:
/bin                       二进制文件程序工具
/boot                     系统启动的必须文件
/dev                      放系统的设备,Linux把外设,磁盘……看成文件
/etc                       放系统配置文件
/home                   普通用户的个人主目录
/initrd                    临时目录,初始化引导用的,一般不用
/lib                        系统库[类似windows dll库]
/lost+found            和windows垃圾箱一样的功能
/misc                    一般不用,不知道功能的东西可以放这里
/mnt                      挂载外部设备的
/opt                       安装第三方软件,一般大的数据库,和服务器可安装在这
/proc                     内存信息
/root                            超级管理员的目录
/sbin                            超级管理员使用的管理工具
/tmp                      临时文件存取目录
/usr                       所有的用户的公共资料、软件和文件
/var                       放的是动态的数据
 
网络设置
/etc/resolov.conf    保存本机默认的域名和DNS服务器信息
/etc/sysconfig/network                有hostname和IP协议
/etc/sysconfig/networking 包括主机基本网络信息,用于系统启动
/etc/sysconfig/network-scripts/ 此目录下是系统启动最初始化网络的信息
/etc/sysconfig/network-scripte/ifcfg-eth0   参数说明如下:
DEVICE=name name表示物理设备的名字
IPADDR=addr addr表示赋给该卡的I P地址
NETMASK=mask mask表示网络掩码
NETWORK=addr addr表示网络地址
BROADCE ST=addr addr表示广播地址
ONBOOT=yes/no 启动时是否激活该卡
BOOTPROTO=proto proto取值可以是none(无须启动协议)、bootp(使用bootp协议)、dhcp(使用DHCP协议)
USERCTL=yes/no 是否允许非root用户控制该设备
ifconfig                 configure a network interface
netconfig               网络配置的文本式的图形工具
route                     show/manipulate[操作,使用] the IP routing[路由选择] table
 
用户环境设置
1、 用户语言环境
locale       get locale[本地] specific[详细的] information
只要设置LANG就可以了,别的都和LANG一样
/etc/sysconfig/i18n         语言设置文件
2、/etc/sysconfig/hwconf     硬件信息
kudzu              detects[检查] and configures new and/or changed hardware on a system
2、 启动配置
chkconfig        updates and queries[查询] runlevel information for system services
setup               一个文本图形工具,可管理启动时的配置(服务,防火墙等)
ntsysv             A tool to set the stop/start of system services in a runlevel.(级别)文本图形
/etc/init.d         所有的启动配置
/etc/rc*.d/              各个级别配置
/etc/inittab              系统初始化的配置文件,决定用那个级别启动
 
附录1.bash_profile和.bashrc的什么区别
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.
并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该
文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该
该文件被读取.
~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件.

另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系.

~/.bash_profile 是交互式、login 方式进入 bash 运行的
~/.bashrc 是交互式 non-login 方式进入 bash 运行的
通常二者设置大致相同,所以通常前者会调用后者