好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > hi 感恩節——Linux基礎教程之mysql和php

hi 感恩節——Linux基礎教程之mysql和php

熱門標簽:測繪地圖標注名稱 商機地圖標注 怎么在百度地圖標注公司的位置 外呼電話系統怎么操作 百度地圖標注直線距離 天津電話外呼系統排名 鶴崗400電話申請 智能電銷機器人有用嗎 德陽400電話申請

感恩節。雖然一直沒有過這個節日的習慣,但僅僅是聽到感恩的消息,都能想到一幅幅畫面。愿大家安好!

學習Linux的前言

選擇了Linux發行版本,你就會想如何開始學習Linux了。

1.當然是安裝Linux了,請上網自行google或者百度,下載redhat linux 5的安裝光盤,然后再安裝vmware,自行安裝

2.多動手,多敲命令。只看書,不實踐,一切都是浮云。默認安裝redhat 5,啟動redhat 5是帶有圖形界面的,但是圖形界面最好少用,對學習Linux不利,一定要盡量用字符界面,慢慢習慣。而工作中,使用Linux,使用圖形界面的概率幾乎是0。所以你去學習圖形界面的技術價值,幾乎為0,性價比不高。

如何學習Linux

1.學習Linux的第一件事情是學習Linux基礎,這方面我推薦鳥哥的私房菜的Linux 基礎文件,里面講解了Linux的文件,磁盤,網絡,進程等,看懂了這本書,并且一個個命令去實踐,你就開始入門Linux了。

2.學習Linux的第二事情就是用Linux。前面說過,Linux的最大用處是服務器領域,所以你要學的第二步是學會架設服務器,這方面我推薦鳥哥的私房菜Linux 架站文件,這本書介紹了很多服務器的假設,沒有必要把全部服務器的架設步驟都看完。個人覺得可以先看完架設服務器的基礎,然后再看看如何搭建web服務器,ftp服務器,telnet服務器,ssh服務器。學會這幾個服務器的搭建,管理,再根據個人興趣和需要選擇其他服務器的搭建。

3.進階——編程。到了這里,你只是會用Linux而已,或許學會少許shell編程,能夠學會簡單的shell,編寫腳本。但是你要進一步熟悉Linux,就要學會Linux編程。例如,Linux的管道是怎么做,Linux的deamon進程是如何實現的,為什么nohub可以讓一個進程可以以daemon形式運行,即使關閉了shell也不會讓這個進程也被關閉。這些,你學會了Linux環境編程,你就豁然開朗了。這里我推薦 《UNIX環境高級編程》,此書是Linux/Unix編程的圣經,堪稱驚世之作。

4.到了這里,你就可以對Linux/Unix有所了解,已經有一定的基礎了,接下來你就要根據你的興趣去選擇你感興趣的方向去學習,或許要根據你的工作方向去學習(很多時候工作不是自己的興趣),師父領進門,修行在個人,以上的學習步驟是我能想到的最簡化的步驟,學習的東西越多,只會讓初學者更迷茫。

下午開題會議還是有所收獲,悄悄的,就變向那個不喜歡自己的人了。

一、Linux基礎(二)

-----Linux常用命令(二)-----

3、文件搜索命令

3.1 文件搜索命令locate

--優點:

搜索速度快(在學習中,要把眼光放遠、放大一點,設想數據量很大的情況或是規模很大的問題的情況)

locate 文件名

--工作原理:

在后臺數據庫按文件名搜索

所以,新創建的文件往往搜索不到(缺點)

解決辦法:等(1天);updatedb命令更新數據庫

--缺點:

只能按照文件名搜索(功能弱)——理解就是,犧牲功能提升速度

--搜索/更新配置:

vi /etc/updatedb.conf

得到

PRUNE_BIND_MOUNTS = "yes"
PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset debugfs devpts ecryptfs exofs fuse fusectl gfs gfs2 hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs sockfs sysfs tmpfs ubifs udf usbfs"
PRUNENAMES = ".git .hg .svn"
PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/cache/ccache /var/spool/cups /var/spool/squid /var/tmp"

第一行就是說,是否執行下列的更新規則

后面是不搜索這些文件夾/文件

所以有時候有些目錄中的內容搜索不到的——比如常用的/tmp

3.2 命令搜索命令whereis和which

3.2.1 whereis

--基本

[root@andy ~]# whereis ls
ls: /bin/ls /usr/share/man/man1p/ls.1p.gz /usr/share/man/man1/ls.1.gz

能搜索到命令的目錄以及其幫助文檔的目錄(所以命令所在位置where is ,同時要牢記,linux中一切皆文件)

--選項

-b 只查找可執行文件

-m 只查找幫助文件

[root@andy ~]# whereis -b mkdir
mkdir: /bin/mkdir

3.2.2 which

--基本

[root@andy ~]# which ls
alias ls='ls --color=auto'
/bin/ls

還會查到別名(如果有的話)。

這里ls會自動顯示不同的顏色

[root@andy ~]# which pwd
/bin/pwd

沒有別名就還是這樣,但沒有幫助文檔

3.2.3 其他說明

--找不到的命令

[root@andy ~]# which cd
/usr/bin/which: no cd in (/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@andy ~]# where cd
-bash: where: command not found

有些類型是找不到的,原因是shell自帶的(以后學)

--path環境變量

環境設定的基本路徑,比如上述(/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

它使我們可以不用絕對路徑來輸入命令——windows也是這樣的

還是那句話,都是文件

path環境變量的定義:系統搜索命令的路徑

自己寫的程序,要么命令都寫絕對路徑,要么放在這些path路徑中

3.3 find命令

最強大的搜索命令——這里只學習基本的、常用的用法

--基本

find [搜索范圍] [搜索條件] 文件名

[root@andy ~]# find / -name install.log
/root/install.log

會發現速度很慢——范圍太大

而且真實情況會更加復雜,有可能速度更慢,壓力更大

——盡量縮小范圍!

而且,如果打算進行模糊匹配,比如install.log.syslog。這個命令是查不到的,要進行通配符匹配,通配符是完全匹配

--通配符

* 匹配任意內容

[root@andy ~]# find /root -name "install.log*"
/root/install.log.syslog
/root/install.log

? 匹配任意一個字符

[] 匹配中括號中的任意一個字符

[root@andy ~]# find /root -name "*[asdf]?"
/root/anaconda-ks.cfg
/root/.viminfo
/root/japan
/root/japan/anaconda-ks.cfg

要注意,find是完全匹配,要小心

--搜索條件

-

find /root -name  install.log  按照文件名搜索

find /root -inname install.log   不區分大小寫

-

find /root -user install.log  按照所有者搜索(不常用)

find /root -nouser 搜索所有沒有所有者的文件(常用)——這種文件很多是垃圾文件,但是有兩種情況除外——內核創建的(sys中);外來文件(比如U盤)

-

find /var/log -mtime +10  查找10天前修改的文件——atime 文件訪問時間,mtime 修改文件時間,ctime 改變文件屬性;+10 10天前修改的文件,-10 10天內,10 10天當天(注意沒有10天后,哈哈)——常用于日志的刪除/篩選中的(默認按天)

-

find . -size 25k 在當前目錄下搜索25k大小的文件——+25或-25也可以

[root@andy ~]# find . -size 25k
[root@andy ~]# ll
總用量 48
-rw-------. 2 root root 1273 11月 26 05:32 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 11月 26 06:05 cangls
-rw-r--r--. 1 root root 26420 11月 25 03:55 install.log
-rw-r--r--. 1 root root 7572 11月 25 03:52 install.log.syslog
drwxr-xr-x. 3 root root 4096 11月 26 05:43 japan
[root@andy ~]# find . -size +25k
./install.log
[root@andy ~]# find . -size -25k
.
./.tcshrc
./anaconda-ks.cfg
./cangls
./install.log.syslog
./.bash_profile
./.bash_logout
./.bash_history
./.bashrc
./.viminfo
./.cshrc
./japan
./japan/anaconda-ks.cfg
./japan/cangls
[root@andy ~]# find . -size -25m
find: 無效的 -size 類型“m”
[root@andy ~]# find . -size -25M
.
./.tcshrc
./anaconda-ks.cfg
./cangls
./install.log.syslog
./.bash_profile
./.bash_logout
./.bash_history
./install.log
./.bashrc
./.viminfo
./.cshrc
./japan
./japan/anaconda-ks.cfg
./japan/cangls
[root@andy ~]#

注意Mb是大寫的M,kb是小寫的k

-

find . -inum 213123 在當前目錄按照i節點搜索213123的文件——常常搭配ls -i使用

-復雜操作

find /etc -size +20k -a -size -50k 這里的-a是與,-o是或
[root@andy ~]# find /etc -size +20k -a -size -50k
/etc/selinux/targeted/modules/active/modules/unprivuser.pp
/etc/selinux/targeted/modules/active/modules/xguest.pp
/etc/selinux/targeted/modules/active/modules/virt.pp
/etc/selinux/targeted/modules/active/modules/postfix.pp
/etc/selinux/targeted/modules/active/modules/unconfineduser.pp
/etc/selinux/targeted/modules/active/modules/nagios.pp
/etc/selinux/targeted/modules/active/modules/cups.pp
/etc/selinux/targeted/modules/active/modules/rhcs.pp
/etc/selinux/targeted/modules/active/modules/apache.pp
/etc/selinux/targeted/modules/active/modules/staff.pp
/etc/selinux/targeted/modules/active/modules/samba.pp
/etc/mime.types
/etc/sysconfig/network-scripts/network-functions-ipv6
/etc/postfix/main.cf
/etc/ld.so.cache
/etc/libreport/events/report_RHTSupportAttach.xml
/etc/libreport/events/report_RHTSupport.xml
/etc/makedev.d/01linux-2.6.x
/etc/sound/events/gnome-2.soundlist
-
find /etc -size +20k -a -size -50k -exec ls -lh {} \;
[root@andy ~]# find /etc -size +20k -a -size -50k -exec ls -lh {} \;
-rw-------. 1 root root 37K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/unprivuser.pp
-rw-------. 1 root root 26K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/xguest.pp
-rw-------. 1 root root 24K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/virt.pp
-rw-------. 1 root root 31K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/postfix.pp
-rw-------. 1 root root 29K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/unconfineduser.pp
-rw-------. 1 root root 21K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/nagios.pp
-rw-------. 1 root root 21K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/cups.pp
-rw-------. 1 root root 26K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/rhcs.pp
-rw-------. 1 root root 27K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/apache.pp
-rw-------. 1 root root 42K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/staff.pp
-rw-------. 1 root root 24K 11月 25 03:46 /etc/selinux/targeted/modules/active/modules/samba.pp
-rw-r--r--. 1 root root 43K 9月 23 2011 /etc/mime.types
-rw-r--r--. 1 root root 30K 7月 22 2014 /etc/sysconfig/network-scripts/network-functions-ipv6
-rw-r--r--. 1 root root 27K 2月 20 2014 /etc/postfix/main.cf
-rw-r--r--. 1 root root 40K 11月 25 03:52 /etc/ld.so.cache
-rw-r--r--. 1 root root 23K 10月 16 2014 /etc/libreport/events/report_RHTSupportAttach.xml
-rw-r--r--. 1 root root 22K 10月 16 2014 /etc/libreport/events/report_RHTSupport.xml
-rw-r--r--. 1 root root 28K 11月 11 2010 /etc/makedev.d/01linux-2.6.x
-rw-r--r--. 1 root root 27K 11月 12 2010 /etc/sound/events/gnome-2.soundlist

這里是用-exec加入第二條命令,執行前面的結果,而且必須加{} /;

------總結

就是find很強大,功能很多,靈活多變;同時帶來了,使用復雜,速度不好定

3.4 grep命令

--基本

搜索字符串:grep [選項] 字符串 文件名

[root@andy ~]# grep "size" anaconda-ks.cfg
#part /boot --fstype=ext4 --size=200
#part swap --size=4000
#part /home --fstype=ext4 --size=2000
#part / --fstype=ext4 --grow --size=200

注意,搜索到的不是符合字符串的文件,而是文件中相應的字符串——與find區分

--選項

-v 取反,即不包含字符串的

-i 不區分大小寫

--與find

find:找文件+完全匹配+使用通配符匹配

grep:找字符串+包含匹配+使用正則表達式匹配

-------------------------------------------------------------------

二、PHP與MySQL

-----文章發布系統實踐(一)-----

理解php操作mysql的方法,熟悉掌握php的mysql函數

1、需求分析

1.1 后臺管理系統

管理-列表

發布,修改,刪除-程序

1.2 前臺展示系統

文章列表,文章內容頁

1.3 數據庫設計

一個表即可,用于存放文章

(我不想畫表格,直接寫數據庫命令好了,但愿以后的我看得懂)

CERATE TABLE article(
id INT(11) PRIMARY KEY AUTO_INCREMENT,
title CHAR(100) NOT NULL,
author CHAR(50) NOT NULL,
description VARCHAR(255) NOT NULL,
content TEXT NOT NULL,
dateline INT(11) NOT NULL DEFAULT 0
);

1.4 項目規劃

項目需要什么文件

2、后臺管理系統

2.1 創建配置文件和初始化文件

您可能感興趣的文章:
  • Linux基礎知識99問(五)
  • Linux基礎知識99問(四)
  • Linux基礎知識99問(二)
  • Linux基礎知識99問(一)
  • Linux下PHP+MYSQL+APACHE配置過程 (摘)
  • linux下安裝apache與php;Apache+PHP+MySQL配置攻略
  • linux php mysql數據庫備份實現代碼
  • linux下apache、mysql、php安裝配置詳細筆記
  • linux基礎之Shell Script入門介紹
  • linux安裝全中文管理面板教程(php+mysql)

標簽:自貢 武漢 六盤水 優質小號 滁州 百色 丹東 鎮江

巨人網絡通訊聲明:本文標題《hi 感恩節——Linux基礎教程之mysql和php》,本文關鍵詞  感恩節,Linux,基礎,教程,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《hi 感恩節——Linux基礎教程之mysql和php》相關的同類信息!
  • 本頁收集關于hi 感恩節——Linux基礎教程之mysql和php的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 俄罗斯美女极品aⅴ| 男把女弄出喷水来视频| 床戏做爰A片一区二区三区小说| 黄色一级视频免费| 日本性视频网站| 美女???免费视频观看| 成人国产精品免费视频不卡| 亚洲一区高清| 91极品反差婊在线观看| 东京热无码A片免费播放 | 好长?好硬?受不了?描写| 秀人网秀人集秀人vip| 免费看少妇高跟鞋A片| 大风掀开裙子美女视频| 午夜视频在线| 电影免费观看网站| 韩国理伦色情理蜜爱00| 日韩一级片网址| 男同桌上课疯狂扒我裤子摸j| 久久精品无码一区三区| 777欧美午夜精品影院| 女人精69xxxxxx| 国产精品社区在线观看| 小黄书成人精品永久免费观看| 久久久欧美精品sm网站| xxxxxxxxxxx性bbbb| 极品白嫩丰满尤物| 攵女乱h边做边打电话| 国产又粗又猛又爽又黄的学生视频| 一级黄电影| 天堂a√中文在线| 白洁被蹂躏之大团结| 5P我被两个黑人包了一夜故事| 真人实拍女处破www免费视频| 插到护士下面取精| 教父电影在线观看高清完整版| sis001第一会所亚洲原创区| 无码无遮大尺度床戏视频网站| 阜平县| 《甜性涩爱》韩国三级| 一级做a爱过程免费视频韩国|