ls -al
pwd
cd -
dates
cal
bc
man &info
locale
LANG=en
sync
shutdonw -h now & half & poweroff关机
reboot
startx & init 5
/work &?work
chgrp
chown
chmod
cp
rm
rmdir
mv 移动
mkdir
touch
cat
nl
more & less
head -n filename
tail -n filename 显示后N行内容
od
df -h 显示分区空间
du 显示目录或文件的大小
fdisk
mkfs
fsck
ln
whereis
locate
find
which
whoami
gcc -v
chattr +i filename 禁止删除
lsattr
updatedb 更新资料库
mke2fs
dd if=/etc/passwdof=/tmp/passwd.bak
mount
mount -t iso9660 /dev/cdrom/mnt/cdrom
mount -t vfat /dev/fd0/mnt/floppy
mount -t vfat -o iocharset=utf8,umask=000 /dev/hda2/mnt/hda2
mount -t ntfs -o nls=utf8,umask=000 /dev/hda3/mnt/hda3
Linux-NTFS Project: http://linux-ntfs.sourceforge.net/
umount /mnt/hda3 缷载
ifconfig
service network restart
ifdown eth0 关闭网卡
ifup eth0
clear
history
stty
fdisk /mbr
at
crontab
&
jobs
fg
bg
kill
ps aux 查看后台程序
top
pstree
killall
free
uptime
netstat
dmesg
nice
renice
runlevel 显示目前的runlevel
depmod
lsmod
modinfo
insmod
modprobe
rmmod
chkconfig
ntsysv
cpio
压缩命令:
*.Z
*.bz2
*.gz
*.tar
*.tar.gz tar 程式打包的檔案,其中並且經過 gzip 的壓縮
compress filename 压缩文件 加[-d]解压 uncompress
gzip filename
bzip2 -z filename 压缩 加[-d]解压
tar -cvf /home/123.tar /etc 打包,不压缩
tar -xvf 123.tar
tar -zxvf /home/123.tar.gz 以gzip解压
tar -jxvf /home/123.tar.bz2 以bzip2解压
tar -ztvf /tmp/etc.tar.gz
cpio -covB >[file|device]
cpio -icduv <[file|device]
vi一般用法
一般模式
h左
j下
k上
l右
0移动到行首
$移动到行尾
H屏幕最上
M屏幕中央
L屏幕最下
G档案最后一行
/work向下搜索
?work向上搜索
gg移动到档案第一行
认识SHELL
alias
type
exprot
exprot PATH="$PATH":/sbin 添加/sbin入PATH路径
echo $PATH
bash
name=yang
unset name
echo $name
myname="$name its me"
ciw=/etc/sysconfig/network-scripts/
env
echo $RANDOM
set
PS1='[\u@\h \w \A #\#]\$'
declare
ulimit -a
ls /tmp/yang && echo "exist" ||echo "not exist"
意思是說,當 ls /tmp/yang 執行後,若正確,就執行echo "exist" ,若有問題,就執行echo "notexist"
echo $PATH | cut -d ':' -f5
export | cut -c10-20
last | grep'root'
cat /etc/passwd |sort
cat /etc/passwd |wc
正规表示法
[root@test root]# grep [-acinv] '搜尋字串' filename
grep -n 'the'123.txt
grep -n 't[ea]st'123.txt
grep -n '[^g]oo'123.txt
grep -n '[0-9]' 123.txt 搜索有0-9的数字
grep -n '^the' 123.txt 搜索以the为行首-----------行首搜索^
grep -n '^[^a-zA-Z]' 123.txt 搜索不以英文字母开头
grep -n '[a-z]$'123.txt
grep -n 'g..d'123.txt
grep -n 'ooo*'123.txt
sed
awd
nl 123.txt | sed '2,5d'
diff
cmp
patch
pr
帐号管理
/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
newgrp
useradd &adduser
/etc/default/useradd
/etc/login.defs
passwd
usermod
userdel
chsh
chfn
finger
id
groupadd
groupmod
groupdel
su test
sudo
visudo
PAM (Pluggable Authentication Modules, 嵌入式模組)
who &w
last
lastlog
talk
write
mesg
wall
mail
/etc/default/useradd
quota
quotacheck
edquota
quotaon
quotaoff
repquota-av
Quota 從開始準備 filesystem 的支援到整個設定結束的主要的步驟大概是:
1、設定 partition 的 filesystem 支援 quota 參數:
由於 quota 必須要讓 partition 上面的 filesystem 支援才行,一般來說, 支援度最好的是 ext2/ext3,
其他的 filesystem 類型鳥哥我是沒有試過啦! 啟動 filesystem 支援 quota 最簡單就是編輯/etc/fstab ,
使得準備要開放的 quota 磁碟可以支援 quota 囉;
2、建立 quota 記錄檔:
剛剛前面講過,整個 quota 進行磁碟限制值記錄的檔案是 aquota.user/aquota.group,
要建立這兩個檔案就必須要先利用 quotacheck 掃瞄才行喔!
3、編輯 quota 限制值資料:
再來就是使用 edquota 來編輯每個使用者或群組的可使用空間囉;
4、重新掃瞄與啟動 quota :
設定好 quota 之後,建議可以再進行一次 quotacheck ,然後再以 quotaon 來啟動吧!
开机流程简介
1、載入 BIOS 的硬體資訊,並取得第一個開機裝置的代號;
2、讀取第一個開機裝置的 MBR 的 boot Loader (亦即是 lilo, grub, spfdisk 等等)的開機資訊;
3、載入 Kernel 作業系統核心資訊, Kernel 開始解壓縮,並且嘗試驅動所有硬體裝置;
4、Kernel 執行 init 程式並取得 run-level 資訊;
5、init 執行 /etc/rc.d/rc.sysinit 檔案;
6、啟動核心的外掛模組 (/etc/modprobe.conf);
7、init 執行 run-level 的各個批次檔( Scripts );
8、init 執行 /etc/rc.d/rc.local 檔案;
9、執行 /bin/login 程式,並等待使用者登入;
10、登入之後開始以 Shell 控管主機。
在/etc/rc.d/rc3.d內,以S开头的为开机启动,以K开头的为关闭,接着的数字代表执行顺序
GRUB vga设定
彩度\解析度 640x480 800x600 1024x7681280x1024
makeclean
make
make install
rpm -q----->查询是否安装
rpm -qi----->查询套件的说明资料
rpm -ivh---->安装
rpm -e------>删除
--nodeps----->强行安装