Comments (7)
No. | command | before | after |
---|---|---|---|
1. | mkdir work |
public_html | public_html work |
2. | cd work |
[_@ip-_--*-** ~]$ cd work | [_@ip-_--*-** work]$ |
3. | vim hello.sh |
hello.sh | |
4. | vim hello.sh |
||
5. | sh hello.sh |
hello world | |
6. | chmod u+wx hello.sh |
hello.sh hello_copy.sh | |
7. | cp hello.sh hello_copy.sh |
hello.sh | hello.sh hello_copy.sh |
8. | mv hello.sh hello_move.sh |
hello.sh hello_move.sh | hello_copy.sh hello_move.sh |
9. | rm work_move.sh |
hello_copy.sh hello_move.sh | hello_copy.sh |
10. | cd |
hello.sh hello_copy.sh | public_html work |
11. | cp -r work work_copy |
public_html work | public_html work work_copy |
12. | mv work_copy work_move |
public_html work work_move | public_html work work_move |
13. | rm -r work_move |
public_html work work_move | public_html work |
14. | history |
||
15. | history | grep ls |
||
16. | man ls |
||
17. | sudo passwd **** |
||
18. | sudo smbpasswd -a **** |
No.18のコマンド入力前に以下の手順でsamba をインストールし,起動させる.
-
/etc/yum.repos.d/にsernet-samba.repoを追加し,以下の内容を記述する.
[sernet-samba]
name=SerNet Samba Team packages (CentOS 5)
type=rpm-md
baseurl=http://ftp.sernet.de/pub/samba/3.5/centos/5
enabled=1
gpgcheck=0 -
sudo yum install samba
sambaインストール -
sudo /etc/init.d/smb start
サーバー起動
参考:http://awstech.blogspot.jp/2012/10/amazonlinuxamisamba.html
from training.
コマンドはOKです!
実行前、実行後の確認や出力結果
ですが、下記の様な形で残すと、時系列で表示出来て見やすくなるのでやってみましょう。
例)
$ cd public_html/
$ ls -l
total 8
-rwx------ 1 *** *** 20 Apr 8 06:02 hello_copy.sh
-rwx------ 1 *** *** 20 Apr 8 05:30 hello_move.sh
実行前後の確認は、ファイルやディレクトリの情報を表示するコマンドを叩いて行います。
またこの研修は公開されているので、issueコメントに記載する場合は、user名とIPアドレスを伏せておきましょう。
@fr-sasaki sambaインストール&起動の部分、御確認お願い致します!
from training.
確認しました。samba部分も特に問題ないです。
ただ、上記のようにコマンドを打つ前と打った後の結果を貼り付けてみましょう。
こんな感じだと見やすいです。
1. ホームディレクトリの下にworkディレクトリを作成
$ ls -l
出力結果
$ mkdir work
$ ls -l
出力結果
2. workディレクトリ内に移動
$ pwd
出力結果
$ cd work
$ pwd
出力結果
from training.
- No.1 ホームディレクトリの下にworkディレクトリを作成
$ ls -l
total 8
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
$ mkdir work
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:29 work
- No.2 workディレクトリ内に移動
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:29 work
$ cd work
$ ls -l
total 0
- No.3 その中にhello.shを作成
$ ls -l
total 0
$ vim hello.sh
$ ls -l
total 0
-rw-rw-r-- 1 **** **** 0 Sep 8 23:34 hello.sh
- No.4 エディタを使いhello.shを次の通り編集
echo "hello world";
1 echo "hello world";
~
~
~
- No.5 hello.shをコマンドで実行
$ sh hello.sh
hello world
- No.6 自分以外のユーザーがhello.shを読み書き実行出来ないようパーミッションを変更
ls -l
total 4
-rw-rw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
$ chmod u+wx hello.sh
$ ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
- No.7 hello.shをhello_copy.shにコピー
ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
$ cp hello.sh hello_copy.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
- No.8 hello.shをhello_move.shにリネーム
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
$ mv hello.sh hello_move.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello_move.sh
- No.9 hello_move.shを削除
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello_move.sh
$ rm work_move.sh
rm: cannot remove 'work_move.sh': No such file or directory
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello_move.sh
- No.10 ホームディレクトリに戻る
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello_move.sh
$ cd
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
- No.11 workディレクトリをwork_copyにコピー
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
$ cp -r work work_copy
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_copy
- No.12 work_copyディレクトリをwork_moveにリネーム
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_copy
$ mv work_copy work_move
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_move
- No.13 work_moveディレクトリを削除
ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_move
$ rm -r work_move
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
- No.14 今まで発行したコマンドの履歴を確認
$ history
1 exit
2 cd
- No.15 14からlsコマンドを使用した行だけを表示
$ history | grep ls
21 ls
23 ls
- No.16 lsコマンドのヘルプを表示
$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
- No.17 自分のアカウントのパスワードを変更
$ sudo passwd ****
- No.18 自分のsambaアカウントを追加
$ sudo smbpasswd -a ****
No.18のコマンド入力前に以下の手順でsamba をインストールし,起動させる.
-
/etc/yum.repos.d/にsernet-samba.repoを追加し,以下の内容を記述する.
[sernet-samba]
name=SerNet Samba Team packages (CentOS 5)
type=rpm-md
baseurl=http://ftp.sernet.de/pub/samba/3.5/centos/5
enabled=1
gpgcheck=0 -
sudo yum install samba
sambaインストール -
sudo /etc/init.d/smb start
サーバー起動
参考:http://awstech.blogspot.jp/2012/10/amazonlinuxamisamba.html
from training.
確認しました!2点気になったところがあるので直してみましょう。
No.6
今回は所有者(=自分)に実行権限を付与する他に、それ以外のユーザに読み書きの権限を許可しない設定が必要です。
各ユーザの権限を1回のコマンドで設定する方法があるので、試してみてください!:+1:
No.9
存在しないファイル名を指定しているようです。
from training.
- No.1 ホームディレクトリの下にworkディレクトリを作成
$ ls -l
total 8
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
$ mkdir work
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:29 work
- No.2 workディレクトリ内に移動
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:29 work
$ cd work
$ ls -l
total 0
- No.3 その中にhello.shを作成
$ ls -l
total 0
$ vim hello.sh
$ ls -l
total 0
-rw-rw-r-- 1 **** **** 0 Sep 8 23:34 hello.sh
- No.4 エディタを使いhello.shを次の通り編集
echo "hello world";
1 echo "hello world";
~
~
~
- No.5 hello.shをコマンドで実行
$ sh hello.sh
hello world
- No.6 自分以外のユーザーがhello.shを読み書き実行出来ないようパーミッションを変更
$ ls -l
total 4
-rw-rw-r-- 1 **** **** 0 Sep 11 18:12 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
$ chmod 700 hello.sh
$ ls -l
total 4
-rwx------ 1 **** **** 0 Sep 11 18:12 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
ref.
http://itpro.nikkeibp.co.jp/article/COLUMN/20060227/230728/
http://motw.mods.jp/UNIX/chmod.html
- No.7 hello.shをhello_copy.shにコピー
ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
$ cp hello.sh hello_copy.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
- No.8 hello.shをhello_move.shにリネーム
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
$ mv hello.sh hello_move.sh
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello_move.sh
- No.9 hello_move.shを削除
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello_move.sh
$ rm hello_move.sh
$ ls -l
total 4
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
- No.10 ホームディレクトリに戻る
$ ls -l
total 8
-rwxrw-r-- 1 **** **** 20 Sep 8 23:43 hello_copy.sh
-rwxrw-r-- 1 **** **** 20 Sep 8 23:37 hello_move.sh
$ cd
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
- No.11 workディレクトリをwork_copyにコピー
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
$ cp -r work work_copy
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_copy
- No.12 work_copyディレクトリをwork_moveにリネーム
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_copy
$ mv work_copy work_move
$ ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_move
- No.13 work_moveディレクトリを削除
ls -l
total 16
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
drwxrwxr-x 2 **** **** 4096 Sep 8 23:50 work_move
$ rm -r work_move
$ ls -l
total 12
drwxrwxr-x 3 **** **** 4096 Aug 8 15:32 public_html
drwxrwxrwx 2 **** **** 4096 Aug 20 16:28 share
drwxrwxr-x 2 **** **** 4096 Sep 8 23:45 work
- No.14 今まで発行したコマンドの履歴を確認
$ history
1 exit
2 cd
- No.15 14からlsコマンドを使用した行だけを表示
$ history | grep ls
21 ls
23 ls
- No.16 lsコマンドのヘルプを表示
$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
- No.17 自分のアカウントのパスワードを変更
$ sudo passwd ****
- No.18 自分のsambaアカウントを追加
$ sudo smbpasswd -a ****
No.18のコマンド入力前に以下の手順でsamba をインストールし,起動させる.
-
/etc/yum.repos.d/にsernet-samba.repoを追加し,以下の内容を記述する.
[sernet-samba]
name=SerNet Samba Team packages (CentOS 5)
type=rpm-md
baseurl=http://ftp.sernet.de/pub/samba/3.5/centos/5
enabled=1
gpgcheck=0 -
sudo yum install samba
sambaインストール -
sudo /etc/init.d/smb start
サーバー起動
参考:http://awstech.blogspot.jp/2012/10/amazonlinuxamisamba.html
from training.
OKです!:+1:
@fr-sasaki @fr-matsuo 確認お願いします!
from training.
Related Issues (20)
- サーバサイド - フレームワーク - フレームワークとは HOT 3
- サーバサイド - フレームワーク - Laravel - インストールと設定 HOT 3
- サーバサイド - フレームワーク - Laravel - routingとview作成
- サーバサイド - フレームワーク - Laravel - テンプレートエンジンのBladeを使う HOT 2
- サーバサイド - フレームワーク - Laravel - Controller作成 HOT 1
- サーバサイド - フレームワーク - Laravel - フォームのバリデーション、CSRF対策 HOT 2
- フロントエンド - JavaScript/jQuery - JavaScript/jQueryを理解する HOT 3
- フロントエンド - JavaScript/jQuery - Hello World!
- フロントエンド - JavaScript/jQuery - 関数を作る
- フロントエンド - JavaScript/jQuery - DOM操作
- フロントエンド - JavaScript/jQuery - イベント操作
- フロントエンド - JavaScript/jQuery - 条件分岐
- フロントエンド - JavaScript/jQuery - ajax通信
- サーバサイド - サーバサイドテスト - 自動ユニットテストの基礎 HOT 3
- サーバサイド - PHP - PHPを理解する HOT 6
- サーバサイド - PHP - PHPを書く HOT 11
- サーバサイド - PHP - フォーム作成
- フロントエンド - JavaScriptTraining HOT 1
- ruby - 環境構築 HOT 8
- ruby - 基本構文 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from training.