婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > linux文件及用戶管理的實(shí)例練習(xí)

linux文件及用戶管理的實(shí)例練習(xí)

熱門標(biāo)簽:外呼線路隨意切換嗎 申請(qǐng)400電話收費(fèi)標(biāo) 滴滴急救中心地圖標(biāo)注 艾澤拉斯地圖標(biāo)注 福州語(yǔ)音電銷機(jī)器人招商 淘寶辦理400電話是多少 菏澤自動(dòng)電銷機(jī)器人公司 北海智能電銷機(jī)器人公司 網(wǎng)絡(luò)電話外呼系統(tǒng)開發(fā)

1、顯示/etc目錄下,以非字母開頭,后面跟了一個(gè)字母以及其它任意長(zhǎng)度任意字符的文件或目錄。

[root@centos7 etc]# ls -d /etc/[^[:alpha:]][:alpha:]*

2、復(fù)制/etc目錄下所有以p開頭,以非數(shù)字結(jié)尾的文件或目錄到/tmp/mytest1目錄中。

[root@centos7 etc]# mkdir /tmp/mytest1 && cp -a /etc/[p]*[^[:digit:]] /tmp/mytest1/
[root@centos7 etc]# ls /tmp/mytest1/ #查看結(jié)果
pam.d passwd- pinforc plymouth pnm2ppa.conf postfix prelink.conf.d profile protocols purple
passwd pbm2ppa.conf pki pm popt.d ppp printcap profile.d pulse python

3、將/etc/issue文件中的內(nèi)容轉(zhuǎn)換為大寫后保存至/tmp/issue.out文件中

[root@centos7 etc]# tr 'a-z' 'A-Z' < /etc/issue >/tmp/issue.out
[root@centos7 etc]# cat /tmp/issue.out 查看內(nèi)容
\S
KERNEL \R ON AN \M

4、請(qǐng)總結(jié)描述用戶和組管理類命令的使用方法并完成以下練習(xí):

(1)、創(chuàng)建組distro,其GID為2019;

[root@centos7 etc]# groupadd distro -g 2019
[root@centos7 etc]# getent group distro #驗(yàn)證distro的GID
distro:x:2019:

(2)、創(chuàng)建用戶mandriva, 其ID號(hào)為1005;基本組為distro;

[root@centos7 etc]# useradd mandriva -u 1005 -g distro
[root@centos7 etc]# id mandriva #驗(yàn)證mandriva的UID號(hào)和基本組
uid=1005(mandriva) gid=2019(distro) groups=2019(distro)

(3)、創(chuàng)建用戶mageia,其ID號(hào)為1100,家目錄為/home/Linux;

[root@centos7 etc]# useradd mageia -u 1100 -d /home/linux
[root@centos7 etc]# getent passwd mageia #驗(yàn)證結(jié)果
mageia:x:1100:1100::/home/linux:/bin/bash

(4)、給用戶mageia添加密碼,密碼為mageedu,并設(shè)置用戶密碼7天后過期

[root@centos7 etc]# echo "mageedu" | passwd mageia --stdin -x 7
[root@centos7 etc]# getent shadow mageia #驗(yàn)證結(jié)果
mageia:!!:18308:0:7:7:::

(5)、刪除mandriva,但保留其家目錄;

[root@centos7 etc]# userdel mandriva
[root@centos7 etc]# ls /home/ #驗(yàn)證結(jié)果 mandriva目錄依舊存在
diyoujia linux mandriva slackware test

(6)、創(chuàng)建用戶slackware,其ID號(hào)為2002,基本組為distro,附加組peguin;

[root@centos7 etc]# useradd slackware -u 2002 -g distro -G peguin
[root@centos7 etc]# id slackware #驗(yàn)證結(jié)果
uid=2002(slackware) gid=2019(distro) groups=2019(distro),2020(peguin)

(7)、修改slackware的默認(rèn)shell為/bin/tcsh;

[root@centos7 etc]# chsh slackware -s /bin/tcsh
[root@centos7 etc]# getent passwd slackware #驗(yàn)證結(jié)果
slackware:x:2002:2019::/home/slackware:/bin/tcsh

(8)、為用戶slackware新增附加組admins;

[root@centos7 etc]# usermod slackware -aG admins
[root@centos7 etc]# id slackware #驗(yàn)證結(jié)果
uid=2002(slackware) gid=2019(distro) groups=2019(distro),2020(peguin),2021(admins)

以上就是本次介紹的全部相關(guān)知識(shí)點(diǎn),感謝大家的學(xué)習(xí),希望腳本之家整理的內(nèi)容能夠幫助到大家。

標(biāo)簽:賀州 丹東 亳州 混顯 三沙 滄州 資陽(yáng) 延安

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《linux文件及用戶管理的實(shí)例練習(xí)》,本文關(guān)鍵詞  linux,文件,及,用戶,管理,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《linux文件及用戶管理的實(shí)例練習(xí)》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于linux文件及用戶管理的實(shí)例練習(xí)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 望奎县| 平原县| 铁岭县| 钦州市| 化德县| 海原县| 邵东县| 上高县| 镇坪县| 彰武县| 丹阳市| 逊克县| 高碑店市| 民丰县| 江油市| 乐昌市| 浦东新区| 宝应县| 峨边| 临夏市| 栾川县| 深圳市| 比如县| 明溪县| 班戈县| 嘉义县| 达拉特旗| 武陟县| 永川市| 甘谷县| 松滋市| 项城市| 习水县| 堆龙德庆县| 那曲县| 马山县| 德清县| 新和县| 大邑县| 来安县| 镇宁|