當前位置:首頁 » 操作系統 » Linuxappendto

Linuxappendto

發布時間: 2022-09-11 07:26:14

『壹』 linux將A.rar解壓到解壓當前目錄並生成一個新文件夾A,在線求指導

linux上有unrar命令,但不是標配,用法:

unrar e 壓縮文件名

$unrar

UNRAR4.20freewareCopyright(c)1993-2012AlexanderRoshal

Usage:unrar<command>-<switch1>-<switchN><archive><files...>
<@listfiles...><path_to_extract>

<Commands>

l[t,b]Listarchive[technical,bare]
pPrintfiletostdout
tTestarchivefiles
v[t,b]Verboselylistarchive[technical,bare]
xExtractfileswithfullpath

<Switches>
-Stopswitchesscanning
@[+]Disable[enable]filelists

ag[format]
aiIgnorefileattributes
ap<path>Setpathinsidearchive
c-Disablecommentsshow
cfg-Disablereadconfiguration
clConvertnamestolowercase
cuConvertnamestouppercase
dhOpensharedfiles
epExcludepathsfromnames

fFreshenfiles
id[c,d,p,q]Disablemessages
ierrSendallmessagestostderr
inulDisableallmessages
kbKeepbrokenextractedfiles
n<file>Includeonlyspecifiedfile
n@
n@<list>
o[+|-]Settheoverwritemode
orRenamefilesautomatically

p[password]Setpassword
p-Donotquerypassword
rRecursesubdirectories
sl<size>
sm<size>
ta<date>Processfilesmodifiedafter<date>inYYYYMMDDHHMMSSformat
tb<date>Processfilesmodifiedbefore<date>inYYYYMMDDHHMMSSformat
tn<time>Processfilesnewerthan<time>
to<time>Processfilesolderthan<time>
ts<m,c,a>[N]Saveorrestorefiletime(modification,creation,access)
uUpdatefiles
vListallvolumes
ver[n]Fileversioncontrol
vpPausebeforeeachvolume
x<file>Excludespecifiedfile
x@
x@<list>
yAssumeYesonallqueries

『貳』 linux怎樣命令行上傳git

你是你是要通過git命令上傳東西,還是想上傳git到伺服器上面,你可以先通過yum安裝git

#yuminstallgit
已載入插件:fastestmirror,refresh-packagekit,security
設置安裝進程
Loadingmirrorspeedslinuxprobe.comfromcachedhostfile
base|3.7kB00:00
epel|4.3kB00:00
epel/primary_db|5.9MB00:05
extras|3.4kB00:00
hhvm|2.9kB00:00
shells_fish_release_2|1.2kB00:00
updates|3.4kB00:00
updates/primary_db|821kB00:01
upgrade|1.9kB00:00
virtualbox/signature|181B00:00
virtualbox/signature|1.1kB00:00...
包git-1.7.1-8.el6.x86_64已安裝並且是最新版本
無須任何處理
#git--help
usage:git[--version][--exec-path[=GIT_EXEC_PATH]][--html-path]
[-p|--paginate|--no-pager][--no-replace-objects]
[--bare][--git-dir=GIT_DIR][--work-tree=GIT_WORK_TREE]
[--help]COMMAND[ARGS]
:
addAddfilecontentstotheindex

branchList,create,,commitandworkingtree,etclogShowcommitlogs

mvMoveorrenameafile,adirectory,orasymlink


rebaseForward-


showShowvarioustypesofobjects

tagCreate,list,
See'githelpCOMMAND'.

下面我給介紹一種從本地上傳到伺服器的命令:

命令rz和sz命令,首先你需要安裝lrzsz庫

#rz--help
rzversion0.12.20
Usage:rz[options][filename.if.xmodem]
ReceivefileswithZMODEM/YMODEM/XMODEMprotocol
(X)=optionappliestoXMODEMonly
(Y)=optionappliestoYMODEMonly
(Z)=optionappliestoZMODEMonly
-+,--appendappendtoexistingfiles
-a,--asciiASCIItransfer(changeCR/LFtoLF)
-b,--binarybinarytransfer
-B,--bufsizeNbufferNbytes(N==auto:bufferwholefile)
-c,--with-crcUse16bitCRC(X)
-C,--allow-remote-(Z)
-D,--nullwriteallreceiveddatato/dev/null
--delay-
-e,--escapeEscapecontrolcharacters(Z)
-E,--
--(debugging)
-h,--helpHelp,printthisusagemessage
-m,--min-
-M,--min-bps-timeNforatleastNseconds(default:120)
-O,--disable-timeoutsdisabletimeoutcode,waitforeverfordata
--o-syncopenoutputfile(s)insynchronouswritemode
-p,--protectprotectexistingfiles
-q,--quietquiet,noprogressreports
-r,--(Z)
-R,--restrictedrestricted,moresecuremode
-s,--stop-at{HH:MM|+N}stoptransmissionatHH:MMorinNseconds
-S,--timesyncrequestremotetime(twice:setlocaltime)
--syslog[=off]turnsyslogonoroff,ifpossible
-t,--
-u,--keep-
-U,--(ifallowedto)
-v,--verbosebeverbose,providedebugginginformation
-w,--windowsizeNWindowisNbytes(Z)
-X--xmodemuseXMODEMprotocol
-y,--overwriteYes,clobberexistingfileifany
--ymodemuseYMODEMprotocol
-Z,--zmodemuseZMODEMprotocol


#sz--help
szversion0.12.20
Usage:sz[options]file...
or:sz[options]-{c|i}COMMAND
Sendfile(s)withZMODEM/YMODEM/XMODEMprotocol
(X)=optionappliestoXMODEMonly
(Y)=optionappliestoYMODEMonly
(Z)=optionappliestoZMODEMonly
-+,--(Z)
-2,--twostopuse2stopbits
-4,--try-4kgoupto4Kblocksize
--start-4kstartwith4Kblocksize(doesn'ttry8)
-8,--try-8kgoupto8Kblocksize
--start-8kstartwith8Kblocksize
-a,--asciiASCIItransfer(changeCR/LFtoLF)
-b,--binarybinarytransfer
-B,--bufsizeNbufferNbytes(N==auto:bufferwholefile)
-c,--(Z)
-C,--command-(Z)
-d,--dot-to-slashchange'.'to'/'inpathnames(Y/Z)
--delay-
-e,--(Z)
-E,--
-f,--full-pathsendfullpathname(Y/Z)
-i,--immediate-commandCMDsendremoteCMD,returnimmediately(Z)
-h,--helpprintthisusagemessage
-k,--1ksend1024bytepackets(X)
-L,--(Z)
-l,--(l>=L)(Z)
-m,--min-
-M,--min-bps-timeNforatleastNseconds(default:120)
-n,--newersendfileifsourcenewer(Z)
-N,--newer-or-(Z)
-o,--16-bit-(Z)
-O,--disable-timeoutsdisabletimeoutcode,waitforever
-p,--(Z)
-r,--(Z)
-R,--restrictedrestricted,moresecuremode
-q,--quietquiet(noprogressreports)
-s,--stop-at{HH:MM|+N}stoptransmissionatHH:MMorinNseconds
--
--tcp-serveropensocket,waitforconnection
-u,--
-U,--(ifallowedto)
-v,--verbosebeverbose,providedebugginginformation
-w,--windowsizeNWindowisNbytes(Z)
-X,--xmodemuseXMODEMprotocol
-y,--
-Y,--overwrite-or-skipoverwriteexistingfiles,elseskip
--ymodemuseYMODEMprotocol
-Z,--zmodemuseZMODEMprotocol


.com。

『叄』 linux下exec函數不返回結果

yes you are right , exec 是不返回的,它將當前進程的內容替換成要執行的程序的內容,這樣就可以運行一個新的程序了。如果exec 返回了說明執行新程序出錯了,內存不夠啊,系統異常啊。。

『肆』 遠程安裝Linux操作系統的方法

遠程安裝Linux操作系統的方法

Linux這個詞本身只表示Linux內核,但實際上人們已經習慣了用Linux來形容整個基於Linux內核,並且使用GNU 工程各種工具和資料庫的操作系統。下面是我收集的關於遠程安裝Linux操作系統的方法,希望大家認真閱讀!

一、引言

一般情況下,我們都是利用軟碟機或光碟機引導Linux後,再通過本地的光碟機安裝Linux。但是,這種安裝方法在以下的幾種情況下就不能適用:

無軟碟機和光碟機:很多公司為了節省成本,計算機一般都不帶光碟機或軟碟機,這樣就無法通過本地安裝Linux;

非標準的軟碟機和光碟機:雖然筆記本都會配置光碟機,但是並不一定都是標準的IDE設備,有些是通過USB介面,有些是通過1394介面(例如Samsung的Q10)。在Linux安裝時所引導的Linux內核一般都不會帶這些介面的驅動,所以也無法通過本地安裝Linux;

另外,在一些場合,如機房中,有大量的計算機需要同時安裝Linux,如果通過光碟機的方式一個個安裝,不僅效率低,也不利於維護。

筆者在工作過程中,就遇到過第二種情況。一台Samsung的Q10筆記本需要安裝Redhat Linux 8.0,但是通過光碟機引導後發現,安裝程序無法訪問光碟。針對這個問題,筆者經過查閱資料和摸索,找到了在Q10上安裝Linux的方法。在下面的討論中,如不做特別聲明,都將以Q10為例,介紹如何通過PXE Bootrom來遠程安裝Linux。

二、基本原理

1) 什麼是PXE

PXE(Pre-boot Execution Environment)是由Intel設計的協議,它可以使計算機通過網路啟動。協議分為client和server兩端,PXE client在網卡的ROM中,當計算機引導時,BIOS把PXE client調入內存執行,並顯示出命令菜單,經用戶選擇後,PXE client將放置在遠端的操作系統通過網路下載到本地運行。

PXE協議的成功運行需要解決以下兩個問題:

既然是通過網路傳輸,那麼計算機在啟動時,它的IP地址由誰來配置;

通過什麼協議下載Linux內核和根文件系統

對於第一個問題,可以通過DHCP Server解決,由DHCP server來給PXE client分配一個IP地址,DHCP Server是用來給DHCP Client動態分配IP地址的協議,不過由於這里是給PXE Client分配IP地址,所以在配置DHCP Server時,需要增加相應的PXE特有配置。

至於第二個問題,在PXE client所在的ROM中,已經存在了Tftp Client。PXE Client使用TFTP Client,通過TFTP協議到TFTP Server上下載所需的文件。

這樣,PXE協議運行的條件就具備了,下面我們就來看看PXE協議的工作過程。

在上圖中,PXE client是需要安裝Linux的計算機,TFTP Server和DHCP Server運行在另外一台Linux Server上。Bootstrap文件、配置文件、Linux內核以及Linux根文件系統都放置在Linux Server上TFTP伺服器的根目錄下。

PXE client在工作過程中,需要三個二進制文件:bootstrap、Linux 內核和Linux根文件系統。Bootstrap文件是可執行程序,它向用戶提供簡單的控制界面,並根據用戶的選擇,下載合適的Linux內核以及Linux根文件系統。

三、步驟

有了前面的背景知識,接下來就可以正式操作了,下面按照順序給出了操作步驟:

1) 配置DHCP Server

選用ISC dhcp-3.0,DHCP Server的配置文件是/etc/dhcpd.conf,配置文件的內容如下:

option space PXE;

option PXE.mtftp-ip code 1 = ip-address;

option PXE.mtftp-cport code 2 = unsigned integer 16;

option PXE.mtftp-sport code 3 = unsigned integer 16;

option PXE.mtftp-tmout code 4 = unsigned integer 8;

option PXE.mtftp-delay code 5 = unsigned integer 8;

option PXE.discovery-control code 6 = unsigned integer 8;

option PXE.discovery-mcast-addr code 7 = ip-address;

class "pxeclients" {

match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";

option vendor-class-identifier "PXEClient";

vendor-option-space PXE;

# At least one of the vendor-specific PXE options must be set in

# order for the client boot ROMs to realize that we are a PXE-compliant

# server. We set the MCAST IP address to 0.0.0.0 to tell the boot ROM

# that we can't provide multicast TFTP (address 0.0.0.0 means no

# address).

option PXE.mtftp-ip 0.0.0.0;

# This is the name of the file the boot ROMs should download.

filename "pxelinux.0";

# This is the name of the server they should get it from.

next-server 192.168.0.1;

}

ddns-update-style interim;

ignore client-updates;

default-lease-time 1200;

max-lease-time 9200;

option subnet-mask 255.255.255.0;

option broadcast-address 192.168.0.255;

option routers 192.168.0.254;

option domain-name-servers 192.168.0.1,192.168.0.2;

option domain-name "mydomain.org";

subnet 192.168.0.0 netmask 255.255.255.0 {

range 192.168.0.10 192.168.0.100;

}

host q10 {

hardware ethernet 00:00:F0:6B:38:5B;

fixed-address 192.168.0.22;

}

dhcpd.conf配置文件中幾個關鍵部分說明如下:host q10{…}定義了筆記本Q10網卡的MAC地址與IP地址的'對應關系,表明DHCP Server為Q10分配一個固定的IP:192.168.0.22;filename ""指定bootstrap的文件名;netx-server指定TFTP Server的地址。其它的配置請讀者參考DHCP Server的手冊。

2) 配置TFTP server

選用tftp-hpa,TFTP Server的配置文件是/etc/xinetd.d/tftp,配置文件的內容如下:

service tftp

{

socket_type = dgram

protocol = udp

wait = yes

user = root

server = /usr/sbin/in.tftpd

server_args = -u nobody -s /tftpboot

disable = no

per_source = 11

cps = 100 2

}

這里制定了/tftpboot為TFTP Server的根目錄位置。

3) 配置bootstrap

bootstrap文件在dhcpd.conf中被指定為pxelinux.0文件,放置在/tftpboot。Linux內核以及Linux根文件系統也放置在/tftpboot。pxelinux.0在執行過程中,要讀配置文件,所有的配置文件都放在/tftpboot/pxelinux.cfg/目錄下。由於PXElinux具有為不同的PXE Client提供不同的Linux內核以及根文件系統的功能,所以要通過不同的配置文件名來區分出不同的PXE Client的需求。比如一個PXE Client由DHCP Server分配的IP地址為192.168.0.22,那麼相對應的配置文件名為/tftpboot/pxelinux.cfg/C0A80016(註:C0A80016為IP地址192.168.0.22的十六進製表示)。如果找不到,就按照順序C0A80016-> C0A8001-> C0A800-> C0A80-> C0A8-> C0A-> C0-> C->default查找配置文件。

/tftpboot/pxelinux.cft/C0A80001配置文件的具體內容如下:

DEFAULT install

PROMPT 1

LABEL install

KERNEL vmlinuz

APPEND initrd=initrd.img devfs=nomount ramdisk_size=16384

此配置文件指定了Linux內核以及根文件系統的名稱,並給內核傳遞了一些參數,其中ramdisk_size參數要非常注意,它指定Linux內核啟動後建立ramdisk的大小,如果設置太小,Linux的安裝過程就可能無法進行。

4) 製作Linux內核/根文件系統

因為需要通過網路安裝,所有選擇Redhat Linux 8.0安裝盤(disk #1)中E:imagesootnet.img(光碟機的盤符為E:)。bootnet.img包括Linux內核、Linux根文件系統(有安裝程序在內)。用bootnet.img製作一張引導軟盤,方法在DOS命令行運行E:dosutils awrite E:imagesootnet.img,根據提示製作。製作完畢後,將引導軟盤中的vmlinuz(Linux內核)和initrd.img(Linux根文件系統)拷貝到Linux Server的/tftpboot下。

5) 啟動DHCP Server/TFTP Server

在Linux Server上,運行service dhcpd start和service xinetd restart。

6) 啟動Q10

Q10加電後,在出現Samsung公司徽標時,在左下角會提示用戶按F12進入網路引導。按F12後,Q10進入網路引導過程。首先通過DHCP Server獲得了IP地址,然後下載並執行bootstrap文件pxelinux.0;在執行中,讀入配置文件/tftpboot/pxelinux.cfg/C0A80016。此時屏幕上出現boot:,敲入install,就進入了Redhat Linux 8.0的網路安裝界面,一切OK!

四、結束語

雖然以上的討論是針對Samsung Q10筆記本,但是工作原理和安裝方法對於其它類型的計算機也是適用的,不過要記住,計算機的網卡中必須要有BootROM--PXE Client。同時,PXE協議也可作為無盤Linux技術,用於引導放置在遠程的Linux。實際上,只要根據需要,在Pxelinux的配置文件的APPEND選項中,為Linux內核傳進需要mount的文件系統的位置參數即可。

;

『伍』 如何編譯linux內核

編譯linux內核步驟:
1、安裝內核
如果內核已經安裝(/usr/src/目錄有linux子目錄),跳過。如果沒有安裝,在光碟機中放入linux安裝光碟,找到kernel-source-2.xx.xx.rpm文件(xx代表數字,表示內核的版本號),比如RedHat linux的RPMS目錄是/RedHat/RPMS/目錄,然後使用命令rpm -ivh kernel-source-2.xx.xx.rpm安裝內核。如果沒有安裝盤,可以去各linux廠家站點或者www.kernel.org下載。
2、清除從前編譯內核時殘留的.o 文件和不必要的關聯
cd /usr/src/linux
make mrproper
3、配置內核,修改相關參數,請參考其他資料
在圖形界面下,make xconfig;字元界面下,make menuconfig。在內核配置菜單中正確設置個內核選項,保存退出
4、正確設置關聯文件
make dep
5、編譯內核
對於大內核(比如需要SCSI支持),make bzImage
對於小內核,make zImage
6、編譯模塊
make moles
7、安裝模塊
make moles_install
8、使用新內核
把/usr/src/linux/arch/i386/boot/目錄內新生成的內核文件bzImage/zImage拷貝到/boot目錄,然後修改/etc/lilo.conf文件,加一個啟動選項,使用新內核bzImage/zImage啟動。格式如下:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
linear
default=linux-new ### 告訴lilo預設使用新內核啟動linux ###
append="mem=256M"
image=/boot/vmlinuz-2.2.14-5.0
label=linux
read-only
root=/dev/hda5
image=/boot/bzImage(zImage)
label=linux-new
read-only
root=/dev/hda5
保留舊有的啟動選項可以保證新內核不能引導的情況,還可以進入linux進行其他操作。保存退出後,不要忘記了最重要的一步,運行/sbin/lilo,使修改生效。
9、重新生成ram磁碟
如果您的系統中的/etc/lilo.conf沒有使用了ram磁碟選項initrd,略過。如果您的系統中的/etc/lilo.conf使用了ram磁碟選項initrd,使用mkinitrd initrd-內核版本號,內核版本號命令重新生成ram磁碟文件,例如我的Redhat 6.2:
mkinitrd initrd-2.2.14-5.0 2.2.14-5.0
之後把/etc/lilo.conf中的initrd指向新生成的initrd-2.2.14-5.0文件:
initrd=/boot/initrd-2.2.14-5.0
ram磁碟能使系統性能盡可能的優化,具體參考/usr/src/linux/Documents/initrd.txt文件
10、重新啟動,OK!

『陸』 linux命令全

linux基本命令:(其他的太多了,自己去網路吧)
ls:
-l:顯示詳細信息
-a:顯示隱藏文件和其他所有文件(以.開頭的為隱藏文件)
-t:安時間排序
-h:以KB MB 等單位顯示
-d:只列出目錄名,不列出其他內容
-R:遞歸顯示所有目錄及子目錄
-lath:選項可以合並

pwd:顯示當前所在位置

cd:轉換目錄
cd ..:返回上一級目錄
cd -:回到上一次操作的目錄

mkdir: 建目錄
-v:顯示所建目錄,相同可用{}:mkdir -v dir{1,2,3}
-p:創建多級目錄

rmdir:刪除空目錄

rm:刪除
-f:強制刪除無提示
-r:可刪除目錄

mv:移動 重命名

touch:建立空文件
file:驗證文件或目錄的類型

cp:復制,粘貼 ()改名
cp 原文件 目標文件
-r:可復制目錄
ssh 192.168.1.33 遠程登錄
跨機拷貝:scp -r /root/Server/ 192.168.1.253:/dcw

man 命令:幫助

alias:查看是否有別名
去掉別名用完整路徑
eg:
#which cp
#/bin/cp a.text b.text 或 \cp a.text b.text
或 在 /root/.bashrc 中去掉#alias cp='cp -i',後#unalias cp

查看某文件前4行內容並顯示文件路徑和文件名
[/usr/local/nagios]#ls /etc/vsftpd/vsftpd.conf && head -n 4 /etc/vsftpd/vsftpd.conf
/etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.

linux tee 命令詳解
功能說明:讀取標准輸入的數據,並將其內容輸出成文件。

語法:tee [-ai][--help][--version][文件...]

補充說明:tee指令會從標准輸入設備讀取數據,將其內容輸出到標准輸出設備,同時保存成文件。

參數:
-a或--append 附加到既有文件的後面,而非覆蓋它.
-i-i或--ignore-interrupts 忽略中斷信號。
--help 在線幫助。
--version 顯示版本信息。
cat /etc/sysconfig/network
-n:查看行號信息

more:空格翻頁 回車換行

less:上下鍵翻頁 可以反復看(可以回翻頁)

head:顯示前幾行
head -5 install.log 顯示前5行

tail:顯示後幾行
tail -f 動態更新

grep:查看文件中包含關鍵字的一行
#grep --color=tty mp intstall.log 彩色顯示
正則表達式:^root 以root為開頭(^)
root$,以root結尾($)
-v:不包括的幾行(取反)
grep -n -v ^# /etc/vsftpd/vsftpd.conf
:r /root/install.log 追加讀入一個文件
:e 讀入文件
:e! 重新讀入
:q 不保存 :q!強制退出
:w 保存 :qw保存退出 :wq! 強制保存退出
在未寫入狀態時:
h 左 k 上 j下 l 右
shift+4($) 游標移到行尾 shift+6(^) 游標移到行頭
:50 來到50行
#vim /root/install.log +50(n)來到50行
:set nu 顯示行號
:set nonu 取消行號
shift+g 來到行尾
n(無顯示)+G:直接來到n行
shift+a:自動來到行尾輸入
:50,100 w bb.txt 保存50到100行的內容到bb.txt中
r :替換單個字元 R:替換全行
shift+o:向上插入 o:向下插入
yy 復制 p 粘貼
(n)2yy 復制前兩行
y^:復制從游標位置到開頭 y$:復制從游標位置到結尾
d:剪貼一行
dd:剪貼兩行
ndd:多行
d^:剪貼到開頭 d$:剪貼到結尾
:g/^$/d 去掉空行
:g/^\s*$/d 去空格
向左移動25個字元:25+l
:/ 查找 自上而下
:? 查找自下而上
n 下一個
替換:
:s/old/new 把舊的換為新的 單個
:s/old/new/g 整行替換
:%s/old/new/g 整個文件替換
:%s/old/new/gc 整個文件替換並詢問
u:替換上次命令
ctrl+r 重做

ctrl+^ 兩個切換
打開多個文件
vim a.txt b.txt c.txt
:args 可選
:next
:prev
:last

vim diff a.txt b.txt
ctrl+w+w 跳到第二個文件
:wqa

使用vimtutor工具聯系vim使用。
vimtutor工具使用方法:
vimtutor zh
如果出現亂馬,使用下面命令解決(只能執行一次)
cd /usr/share/vim/vim70/tutor
mv tutor.zh.euc tutor.zh.euc.bak
iconv -f gb2312 -t utf-8 tutor.zh.euc.bak > tutor.zh.euc
vimtutor zh

locate :空間換時間
updatedb
locate passwd

find [路徑] [參數] [表達式]
find /usr/share/doc -name filename
-user:根據文件擁有者尋找文件
-group:根據文件所屬組尋找文件
-name:根據文件名尋找文件
-perm:根據文件許可權尋找
-size:根據文件大小尋找
-type:根據文件類型尋找文件,參數對應c b l f d
find 的表達式使用通配符時需要使用「」圈界
find 目錄 條件 條件
[root@localhost ~]# find / -name "pass*"
當前目錄:.
find . -name "*ss*"
find . -type f(文件)
find . -type d(目錄)
[root@localhost ~]# find . -nouser(文件無屬主)
[root@localhost ~]# find . -nogroup(文件無屬組)
[root@localhost ~]# find /home/ -user/group user1
-exec
[root@localhost ~]# find . -nouser -exec rm {} \;
{}代表文件和目錄
\轉義字元
-ok
find . -nogroup -ok rm -rf {} \;有提示刪除

[root@localhost ~]# stat a
File: 「a」
Size: 0 Blocks: 0 IO Block: 4096 一般空文件
Device: 803h/2051d Inode: 261796 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2011-04-02 14:23:25.000000000 +0800(創建時間:-atime)
Modify: 2011-04-02 14:23:25.000000000 +0800(修改時間:-mtime)
Change: 2011-04-02 14:23:25.000000000 +0800(改變屬組屬主會變:-ctime)

find /root -mtime -5(5天以內) 5(5天時) +5(5天前)

find . -perm 400:要求許可權全部匹配,精確匹配
find . -perm +600(wr):有w,r中任意許可權的都會列出,即會列出200 400 600 的許可權
find . -perm -600 :要求許可權完全滿足 許可權大於等於600

-name -type
-name -user
-perm -type
-nouser
-nogroup
-mtime
-exec
-ok
-rgex(正則表達式)

『柒』 Linux文本模式下的命令行提示符

(3) matchbeep:
這個變數是用來控制何時發出警告聲,也就是『畢』的一聲,它具有下列幾個值
可供設定:
nomatch: 為找出符合的檔案或命令時,發出警告聲。
ambiguous: 有很多檔案或命令符合時,發出警告聲。
notunique: 找到一精確符合的,但還有其他較長而且符合的檔名或命令時,發出
警告聲。
never: 無論在任何情況下都不發出警告聲。
輸入: >set matchbeep=never 試試

『捌』 linux 編譯內核make-kpkg clean 與make mrproper區別

make-kpkg是debian自己開發的工具
make-kpkg clean = make distclean
一般在make-kpkg -initrd --initrd --append-to-version=XX kernel_image之前用

make mrproper要刪除.config,一般在生成.config之前用

『玖』 LINUX中,假設SAMBA中創建了用戶SAMBAUSER,創建了組TEST,如何 將用戶添加到組中

打開終端將一個用戶添加到用戶組中,千萬不能直接用:
usermod -G groupA

這樣做會使你離開其他用戶組,僅僅做為 這個用戶組 groupA 的成員。
應該用 加上 -a 選項:
usermod -a -G groupA user
(FC4: usermod -G groupA,groupB,groupC user)
-a 代表 append, 也就是 將自己添加到 用戶組groupA 中,而不必離開 其他用戶組。

命令的所有的選項,及其含義:
Options:
-c, --comment COMMENT new value of the GECOS field
-d, --home HOME_DIR new home directory for the user account
-e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-f, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-g, --gid GROUP force use GROUP as new primary group
-G, --groups GROUPS new list of supplementary GROUPS
-a, --append append the user to the supplemental GROUPS
mentioned by the -G option without removing
him/her from other groups
-h, --help display this help message and exit
-l, --login NEW_LOGIN new value of the login name
-L, --lock lock the user account
-m, --move-home move contents of the home directory to the new
location (use only with -d)
-o, --non-unique allow using plicate (non-unique) UID
-p, --password PASSWORD use encrypted password for the new password
-s, --shell SHELL new login shell for the user account
-u, --uid UID new UID for the user account
-U, --unlock unlock the user account

查看用戶所屬的組使用命令:$ groups user
或者查看文件:$ cat /etc/group

熱點內容
cl編譯選項 發布:2025-05-14 11:09:25 瀏覽:620
自製演算法表 發布:2025-05-14 11:05:18 瀏覽:357
android獲取手機聯系人 發布:2025-05-14 10:59:30 瀏覽:141
電腦怎麼選擇配置 發布:2025-05-14 10:46:12 瀏覽:326
電腦怎麼不顯示手機連接伺服器失敗 發布:2025-05-14 10:42:28 瀏覽:10
安卓如何下載lv手游 發布:2025-05-14 10:35:45 瀏覽:384
pythondict添加key 發布:2025-05-14 10:33:59 瀏覽:382
柱子箍筋加密區長度 發布:2025-05-14 10:18:29 瀏覽:352
雲伺服器和內網穿透哪個好 發布:2025-05-14 10:16:41 瀏覽:627
安徽新能源網路配置是什麼 發布:2025-05-14 10:06:24 瀏覽:631