Linux
startx 轉到圖形界面
whoami 當前使用中的用戶
cd dev 打開文件夾
Linux 分區的命名 /dev/xxyN
/dev/ 這個字串是所有設備文件所在的目錄名
邏輯分區永遠從5開始
主分區和擴展分區最多有4個
手動分區
/ 根分區
/usr 應用軟件存放位置
/home 用戶宿主目錄的父目錄
/var 存放臨時文件
/boot 存放啓動文件128M is enough
SWAP 交換分區
至少兩個分區
/分區
SWAP分區 虛擬分區
個人桌面分區
/分區
/boot 分區
/usr 分區
SWAP分區
rmdir cdrom 刪除文件夾
mkdir cdr建立文件夾
pwd 查看當前路徑
mount /dev/cdrom /mnt/cdr 掛載設備
umount /dev/cdrom 卸載設備
Linux目錄結構
/ Linux文件系統的入口,也是處於最高一級的目錄
/bin 基礎系統所需要的那些命令位於此目錄,也是最小系統所需要的命令 比如 ls cp mkdir等命令:功能和、usr、bin類似,這個目錄中的文件都是可執行的,普通用戶都可以使用的命令。座位基礎系統所需要的最基礎的命令就放在在這裏。
/boot Linux的內核及引導系統程序所需要的文件
/dev 設備文件存儲目錄,比如聲卡,磁盤,,,
/etc 系統配置文件的所在地,一些服務器的配置文件也在這裏:比如用戶帳號 密碼配置文件
/home 普通用戶目錄 默認存放目錄
/lib 庫文件存放目錄
Boot sequence(important)啓動順序
1.load bios (hardware information)
2.Read MBR's config to find out the OS(Operation System)
3.Load the kernel of the OS
4.Init process starts... 初始化
5.Execute /etc/rx d/sysinit
6.Start other modules
7.Execute the run level scripts.腳本
8.Execute /etc/rc d/rc.local腳本,開機自啓動
9.Execute /bin/login
10.Shell started...
rc.local : impotant
shutdown --help 幫助
poweroff 關機
常用命令
ls ls -l 豎着 ls -m 橫着
pwd 查看當前路徑
rmdir 刪除空文件夾
rm -r 文件夾名 詢問遞歸
rm -rf 文件名 直接刪除
touch 1 創建文件 (Linux下文件名後綴沒有意義)
cp(copy)
vi 文本編輯器
vi 1.txt 編輯文本1.txt
ESC 退出
:w 保存
:wq 保存退出
more 1.txt 查看文件1.txt的內容
cat 1.txt 正序
tac 1.txt 倒序
head -2 1.txt 列出前兩行
tail -2 1.txt 列出後兩行
find 查找
find / -name 1.txt
whereis ls 查看命令的路徑
命令的執行程序的路徑
ln 1.txt 4 4是指向1.txt的連接,並拷貝一份,同時改變
ln -r 1.txt 4 軟連接
用戶管理:
useradd testuser
cd /home
ls
passwd testuser
cd /etc
more passwd passwd存放所有的用戶
userdel testuser
cd /home
rm -rf testuser
su(switch user)
echo $PATH
查看路徑存放的內容
very important
文件
r read w write x execute
chmod +x 4
chmod u+x 4
chmod g+x 4
Chmod 777 4
chmod 755 4
前綴
d 文件夾
l 連接
- 文件
chown mengmeng 4 修改文件所有者
wc word count 統計文本字符
grep mengmeng 1.txt
在1.txt文件中查看哪一行包含了mengmeng
uname 操作文件系統信息
Ctrl + c結束
管道 連接命令
將一個命令的輸入傳送給另一個命令,座位另外一個命令的輸入
ftp配置
service vsftpd start
ifconfig 查看ip地址
Linux 有一塊網卡
reboot重啓
ping ip 測試是否通暢
service iptables stop 關閉防火牆
ftp配置
/etc/vsftpd/vsftpd.conf
service vsftpd restart
本文出自 “Kenan_ITBlog” 博客,請務必保留此出處http://soukenan.blog.51cto.com/5130995/1127369