当前位置:首页 » 操作系统 » 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

热点内容
存储服务器分类 发布:2025-05-14 08:39:01 浏览:645
xz文件解压软件 发布:2025-05-14 08:28:43 浏览:969
lua脚本学习 发布:2025-05-14 08:20:55 浏览:713
python文件删除一行 发布:2025-05-14 08:06:58 浏览:721
如何下载奥特曼高级化3安卓版 发布:2025-05-14 07:47:31 浏览:346
qml文件修改后编译未生效 发布:2025-05-14 07:31:00 浏览:331
内到内算法 发布:2025-05-14 07:29:11 浏览:34
文件夹名字不显示 发布:2025-05-14 07:27:47 浏览:775
oracle的数据库驱动jar 发布:2025-05-14 07:23:20 浏览:556
我的世界电脑版服务器手机版能进吗 发布:2025-05-14 07:22:01 浏览:680