練習問題
練習問題
問1 空欄に入る適切なコマンドを入力してください。
実行結果
[user01@localhost ~]$ touch test.txt [user01@localhost ~]$ ls -l -rw-rw-r--. 1 user01 user01 0 6月 12 15:10 test.txt [user01@localhost ~]$ ??? [user01@localhost ~]$ ls -l -rw-rw-r--. 1 user01 user01 0 6月 12 15:10 test1.txt [user01@localhost ~]$ ??? [user01@localhost ~]$ ls –l -rw-rw-r--. 1 user01 user01 0 6月 12 15:10 test1.txt -rw-rw-r--. 1 user01 user01 0 6月 12 15:13 test2.txt [user01@localhost ~]$ ??? [user01@localhost ~]$ ls –l test1.txt test2.txt ls: test1.txt にアクセスできません: そのようなファイルやディレクトリはありません ls: test2.txt にアクセスできません: そのようなファイルやディレクトリはありません
図
![](https://kanda-it-school-kensyu.com/wp-content/uploads/efc92a4dbca5e8c85a06953ecd9e032f.png)
問2 空欄に入る適切なコマンドを入力してください。
実行結果
[user01@localhost ~]$ mkdir test [user01@localhost ~]$ ls -l drwxrwxr-x. 2 user01 user01 6 6月 12 15:35 test [user01@localhost ~]$ ??? [user01@localhost ~]$ ls -l drwxrwxr-x. 2 user01 user01 6 6月 12 15:35 test1 [user01@localhost ~]$ ??? [user01@localhost ~]$ ls -l drwxrwxr-x. 2 user01 user01 6 6月 12 15:35 test1 drwxrwxr-x. 2 user01 user01 6 6月 12 15:41 test2 [user01@localhost ~]$ ??? [user01@localhost ~]$ ls -l test1 test2 ls: test1 にアクセスできません: そのようなファイルやディレクトリはありません ls: test2 にアクセスできません: そのようなファイルやディレクトリはありません
図
![](https://kanda-it-school-kensyu.com/wp-content/uploads/ea28deb5a180085235cb5c6a2d9e325e.png)
問3 ディレクトリ「/proc/driver」をアーカイブ圧縮し、展開してください。
実行結果
[user01@localhost ~]$ ??? tar: メンバ名から先頭の `/' を取り除きます /proc/driver/ /proc/driver/rtc /proc/driver/nvram [user01@localhost ~]$ ??? proc/driver/ proc/driver/rtc proc/driver/nvram
図
![](https://kanda-it-school-kensyu.com/wp-content/uploads/805e8dce03356f6ecfd0ebaa5b2f558f.png)
問4 「/etc/passwd」ファイルの内容を持つファイル「test.txt」を作成してください。
実行結果
[user01@localhost ~]$ ??? [user01@localhost ~]$ less test.txt root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin …
図
![](https://kanda-it-school-kensyu.com/wp-content/uploads/0c56e1e70a3584c145ace5a09c99dcc8.png)
問5 コマンド「ls」の結果を逆順で出力してください。※ 並び替えはコマンド「sort」で行います。
実行結果
[user01@localhost ~]$ touch a b c d e [user01@localhost ~]$ ls a b c d e [user01@localhost ~]$ ??? e d c b a
図
![](https://kanda-it-school-kensyu.com/wp-content/uploads/7cc3ea980d86ede6b7d7ada8d0c62733.png)