1.リストのすべてのvi、vimのエディタの編集モードは、ノーマルモード、コマンドモードを知っています。3つのモードで運転指令
编辑模式:无
普通模式:G gg yy p d dd D u r x $ ^ dG i a o A I O
命令模式: : / :wq :x shift+zz :set nu :set ic :set list
現在のシステムの場合には2を除去し、空間セパレータとして、現在のネットワーク出口の(パブリックIP)アドレスを参照してください「データ2」ラインが配置されて抽出されたキーワードをコマンド(カールcip.cc)を使用して百度にpingを実行できます第3列の内容
[root@chengyinwu ~]# curl cip.cc |grep '数据二' |awk '{print $3}'
すべてのユーザーファイルを保存する3.linuxシステムは、パスワード情報がありますか?
/etc/shadow
/etc/passwd
5.ストアのユーザーアカウント情報のプロファイルがありますか?
/etc/default/useradd
/etc/login.defs
6.変更し、ファイルの所有者の命令(B)
A.chmod
B.chown
C.cat
D.vim
仮定ユーザーのDavid 7.ピーター・R&D部門、グループA、グループBに属するユーザの生活laowang金融ユニットに属する
(1)それぞれのユーザーとグループを設置し、対応関係を設定します
[root@yinwucheng ~]# groupadd A
[root@yinwucheng ~]# useradd David -g A
[root@yinwucheng ~]# useradd Peter -g A
[root@yinwucheng ~]# id David
uid=1124(David) gid=1126(A) groups=1126(A)
[root@yinwucheng ~]# groupadd B
[root@yinwucheng ~]# useradd life -g B
[root@yinwucheng ~]# useradd laowang -g B
[root@yinwucheng ~]# id life
uid=1126(life) gid=1127(B) groups=1127(B)
(2)ディレクトリoffice_aを作成し、ファイルやフォルダのみ、追加、削除、変更、および実行し、R&D人材で読み取ることができ、他のユーザーは、ディレクトリ上の任意の操作を行うことができません
[root@yinwucheng ~]# mkdir office_a //建目录
[root@yinwucheng ~]# ll -d office_a/ //查看默认权限
drwxr-xr-x. 2 root root 6 Aug 9 16:03 office_a/
[root@yinwucheng ~]# chmod 750 office_a/
[root@yinwucheng ~]# ll -d office_a/
drwxr-x---. 2 root root 6 Aug 9 16:03 office_a/
(3)、ファイルをディレクトリOffice_bの作成またはフォルダが財務部によってのみ読み取ることができ、追加、削除、変更、および実行し、他のユーザーは、ディレクトリ上の任意の操作を行うことができません
[root@yinwucheng /tmp]# mkdir office_b
[root@yinwucheng /tmp]# ll -d office_b
drwxr-xr-x. 2 root root 6 Aug 10 14:44 office_b
[root@yinwucheng /tmp]# chown .B office_b
[root@yinwucheng /tmp]# chmod 770 office_b
(4)のみ表示を行うことができ、他の業務部門を、削除、追加、ファイルまたはフォルダの研究開発スタッフが読み取ることができ、ディレクトリoffice_cを作成、変更、および実行
[root@yinwucheng /tmp]# mkdir office_c
[root@yinwucheng /tmp]# ll -d office_c
drwxr-xr-x. 2 root root 6 Aug 10 14:46 office_c
[root@yinwucheng /tmp]# chown .A office_c
[root@yinwucheng /tmp]# chmod 774 office_c
(5)、ファイルまたはフォルダをディレクトリoffice_dを作成のみR&D部門のマネージャーダビデは、すべての操作権限を持っている他の人が唯一のR&D部門を表示する権限があり、他の部門は、任意の操作を行うことができません
[root@yinwucheng /tmp]# mkdir office_d
[root@yinwucheng /tmp]# ll -d office_d
drwxr-xr-x. 2 root root 6 Aug 10 14:49 office_d
[root@yinwucheng /tmp]# chown David.A office_d
[root@yinwucheng /tmp]# chmod 740 office_d
[root@yinwucheng /tmp]# ll -d office_d
drwxr-----. 2 David A 6 Aug 10 14:49 office_d
8.新しいディレクトリ/ web1と、/ WEB2、/ web3
[root@yinwucheng ~]# mkdir /web{1..3}
(1)変更/ web1とディレクトリのパーミッションを他のユーザーがそれにどんな権限がありませんように。
[root@yinwucheng ~]# ll -d /web1
drwxr-xr-x. 2 root root 6 Aug 9 17:22 /web1
[root@yinwucheng ~]# chmod 750 /web1
[root@yinwucheng ~]# ll -d /web1
drwxr-x---. 2 root root 6 Aug 9 17:22 /web1
(2)変更のアクセス許可/ WEB2ディレクトリを、それが実行する読み取りおよび書き込み権限たグループに属します。
[root@yinwucheng ~]# ll -d /web2
drwxr-xr-x. 2 root root 6 Aug 9 17:22 /web2
[root@yinwucheng ~]# chmod 775 /web2
[root@yinwucheng ~]# ll -d /web2
drwxrwxr-x. 2 root root 6 Aug 9 17:22 /web2
(3)変更/ web3ディレクトリのパーミッションを、任意のユーザは、グループGRP1に属しているすべてのファイルを読み書きますが、/ web3ディレクトリに作成することができます
[root@yinwucheng /tmp]# groupadd grp1
[root@yinwucheng /tmp]# chgrp grp1 /web3
[root@yinwucheng /tmp]# chmod 777 /web3
[root@yinwucheng /tmp]# ll -d /web3
drwxrwxrwx. 2 root grp1 6 Aug 10 15:22 /web3
[root@yinwucheng /tmp]# chmod g+s /web3
[root@yinwucheng /tmp]# ll -d /web3
drwxrwsrwx. 2 root grp1 6 Aug 10 15:22 /web3
9.新しいユーザーzhangsan、リージは、wangergou、3人のユーザが同じユーザグループF4に属し、パスワードがoldboyです
[root@yinwucheng ~]# groupadd f4
[root@yinwucheng ~]# useradd zhangsan -g f4
[root@yinwucheng ~]# useradd lisi -g f4
[root@yinwucheng ~]# useradd wangergou -g f4
[root@yinwucheng ~]# echo "oldboy" |passwd --stdin zhangsan
Changing password for user zhangsan.
passwd: all authentication tokens updated successfully.
[root@yinwucheng ~]# echo "oldboy" |passwd --stdin lisi
Changing password for user lisi.
passwd: all authentication tokens updated successfully.
[root@yinwucheng ~]# echo "oldboy" |passwd --stdin wangergou
Changing password for user wangergou.
passwd: all authentication tokens updated successfully.
(1)ユーザーおよびグループは、/データ/コードディレクトリにあることができる上に、アクセスは、作成、ファイルを削除し、他のユーザーがディレクトリにアクセスすることはできません
[root@yinwucheng /tmp]# mkdir -p /data/code
[root@yinwucheng /tmp]# chown .f4 /data/code/
[root@yinwucheng /tmp]# ll -d /data/code/
drwxr-xr-x. 2 root f4 6 Aug 10 15:38 /data/code/
[root@yinwucheng /tmp]# chmod 770 /data/code/
(2)コードディレクトリに作成されたすべてのファイルが自動的にすべてのF4のグループに割り当てられています
[root@yinwucheng /tmp]# chmod g+s /data/code/
(3)今、それはデフォルトのグループに属し、ユーザーの数を追加し、他のユーザーがコードディレクトリへの読み取りアクセスを開く必要があります
[root@yinwucheng /tmp]# chmod 774 /data/code/
(4)他のユーザーが作成したすべての新しいファイルは自動的にコードディレクトリのF4グループに帰属します
[root@yinwucheng /tmp]# chmod 777 /data/code/
10. 2つのユーザー・グループ、それぞれのpythonグループ、Linuxグループがありますが、人々のグループは、PythonのPythonのグループを変更することができますファイルを読み取るが、あなたは、人々がLinuxグループを読んで聞かせすることはできません。人々は、Linuxのグループは、Linuxのグループを変更することができます読みますファイルが、あなたは、人々がPythonのグループを読み聞かせすることはできません。
[root@yinwucheng ~]# groupadd python
[root@yinwucheng ~]# groupadd linux
[root@yinwucheng ~]# mkdir /python
[root@yinwucheng ~]# chown .python /python/
[root@yinwucheng ~]# chmod 770 /python/
[root@yinwucheng ~]# mkdir /linux
[root@yinwucheng ~]# chown .linux /linux
[root@yinwucheng ~]# chmod 770 /linux/
11. DF -h入力し、現在のシステム利用可能なディスク容量の残りのルートパーティションを削除します
[root@chengyinwu ~]# df -h |awk 'NR==2 {print $4}'
36G
線S(無視する場合)から出発してディスプレイの/ proc / meminfoのファイル
[root@yinwucheng ~]# grep -i '^s' /proc/meminfo
614へのファイルのパーミッションを想定し、現在のディレクトリに13の新しいテキストファイル、。ファイルの所有者を設定するために必要とされる(u)は、他のユーザ(O)へのアクセス権、グループ(G)の増加書き込み権限を実行読み取る権限を削除して増加し、操作方法を、改訂された権利に加えて、文字がどのように示すべきです
[root@yinwucheng ~]# touch text
[root@yinwucheng ~]# chmod 614 text
[root@yinwucheng ~]# chmod u+x text
[root@yinwucheng ~]# chmod g+w text
[root@yinwucheng ~]# chmod o-r text
[root@yinwucheng ~]# ll
-rwx-wx---. 1 root root 0 Aug 10 16:19 text
14.現在のディレクトリAAAにディレクトリを作成し、ディレクトリのパーミッションは、読み取り、書き込み、および実行権限をするだけで、メインファイルに設定
[root@yinwucheng ~]# mkdir aaa
[root@yinwucheng ~]# chmod 700 aaa/
15.ファイルmyfileを-rw-rにアクセス権のセット - r--のは、誰にでも実行権限を高めるために、それがどのように行うべきです
[root@yinwucheng ~]# touch myfile
[root@yinwucheng ~]# chmod 644 myfile
[root@yinwucheng ~]# chmod o+x myfile
16.コマンド入力時間「日」は現在のシステム時刻の/data/1.txtに出力されます。
[root@yinwucheng ~]# date > /data/1.txt
17.コマンド入力時間「日付」は、現在のシステム時間/data/1.txtに追加されます
[root@yinwucheng ~]# date >> /data/1.txt
現在のシステムの場合18.「ピング-C3 baidu.com」出力/data/1.txtに戻り用いて百度にpingを実行できます
[root@chengyinwu ~]# ping -c3 baidu.com > /data/1.txt
19.接続タイトル、/data/1.txt、最初の行のキー抽出時間の発生は、ライン遅延情報は、次に、抽出(情報の値が消費されるに等しい時間遅延)で消費されます
[root@chengyinwu ~]# grep 'time' /data/1.txt |awk 'NR==1 {print $8}' |awk -F "=" '{print $2}'
27.5
20.使用する「LS / TA」エラーメッセージが/data/1.txtに出力されます
[root@chengyinwu ~]# ls /ta 2> /data/1.txt
標準出力に21 /data/1.txtコンテンツファイル、/data/2.txt
[root@chengyinwu ~]# cat /data/1.txt > /data/2.txt
22.次は、Linuxの標準入力と出力のファイル記述子の意味を説明
0 | --- >>>デフォルトの標準入力はキーボードですが、それはファイルや他のコマンドの出力が可能 |
---|---|
1 | 画面に--- >>>デフォルトの出力を標準出力 |
2 | 画面に--- >>>デフォルトのエラー出力 |
23.以下は、標準入力と出力のシンボルでのLinuxの意味を説明します
< 输入重定向
<< 追加输入重定向
> 输出重定向
>> 追加输出重定向
2> **错误覆盖输出重定向**
2>> **错误追加输出重定向**
`&>`or `>&` or `2>&1` **把标准输出和标准错误作为同一个数据流重定向到文件**
&> 混合输出重定向
&>> **把标准输出和标准错误作为同一个数据流重追加重定向到文件**
24.使用「配列10 50」の端3.txt 0に標準出力線であろう
[root@yinwucheng ~]# seq 10 50 |grep '0$' >3.txt
ファイル名fstab.outの下で/ tmpディレクトリにリダイレクト25. / etc / fstabファイルの内容
[root@yinwucheng ~]# cat /etc/fstab > /tmp/fstab.out
26.キャラクター「Hello World」のファイル/tmp/fstab.outの最後に追加
[root@yinwucheng ~]# echo "hello world" >> /tmp/fstab.out