Using Bash to Best Effect in Ubuntu bashを使用し、効果を最大限にubuntu
Basically, in the Bash environment, an administrator is working with text commands.基本的には、 bashの環境では、管理者がテキストを使いこなすのコマンドです。 An example of such a command is ls, which can be used to display a list of files in a directory.の例をlsコマンドは、このようなことができる表示に使用される、ディレクトリ内のファイルのリストを表示します。 Bash has some useful features to make working with these line commands as easy as possible. bashのにはいくつかの便利な機能を搭載し、これらのラインの作業をできるだけ簡単にするコマンドです。 Some shells offer the option to complete a command automatically.いくつかのシェルコマンドを終了するオプションを提供して自動的に起動します。 Bash has this feature, but it does more than just complete commands.この機能はbashのは、それが完了するというだけのコマンドです。 Bash can complete almost everything: not just commands, but also file names and shell variables. bashのほとんどすべてを完了する:特定のコマンドだけではなく、ファイル名や、シェル変数です。
Using Automatic Command Completion 自動コマンドを使用して完成
Using this feature is as simple as pressing the Tab key.この機能を使用しては、簡単ですがキーを押して、タブをクリックします。 For example, the cat line command is used to display the contents of an ASCII text file.たとえば、コマンドラインを使用して、猫の内容を表示するにはASCIIテキストファイルです。 The name of this file, which is in the current directory, is this_is_a_file.このファイルの名前を、これは、現在のディレクトリでは、 this_is_a_fileです。 So, to open this file, the user can type cat thi and then press the Tab key.そのため、このファイルを開くに、ユーザーがthiのタイプの猫と入力し、 Tabキーを押します。 If the directory has only one file that starts with the letters thi, Bash automatically completes the name of the file. 1つだけの場合、ディレクトリにファイルを起動thiの3文字は、 bashのファイルの名前を自動的に完了します。 If the directory has other files that start with the same letters, Bash will complete the name of the file as far as possible.他のファイルの場合、ディレクトリは、同じ文字がスタートしたのは、 bashのファイルの名前を完了するには、可能な限りです。 For example, let’s say that there is a file in the current directory with the name this_is_a_text_file and another named thisAlsoIsAFile.たとえば、レッツが存在することを言ってやるが、現在のディレクトリにファイルをthis_is_a_text_fileと別の名前の名前thisalsoisafileです。 Because both files start with the text this, Bash will complete only up to this and no further.スタート]ボタンを両方のファイルは、テキストのためには、 bashのは、完全なだけにこれとこれ以上のです。 To display a list of possibilities, you then press the Tab key again.可能性のリストを表示するには、 Tabキーを押しますを入力してください。 This allows you to manually enter more information.これにより、他の情報を手動で入力します。 Of course, you can then use the Tab key again to use the completion feature once more.もちろん、することができますを再度入力しTabキーを使用して補完機能を使用して一度です。
Working with the Tab key really makes the command line interface much easier.実際の作業は、タブキーにより、コマンドラインインターフェイスをはるかに容易です。 Imagine that you need to manage logical volumes on your server and you remember only that the command for that starts with lv.想像して論理ボリュームを管理する必要としているサーバー上のコマンドを覚えて、そのことだけが始まります左心室です。 In this case, you can type lv and press the Tab key twice.この場合には、左心室と入力することができます]タブキーを2回押してください。 The result will be a nice list of all commands that start with lv, from which you’ll probably recognize the command that you need.ニースの結果が表示されるの全リストを表示するコマンドをスタート]ボタンを左心室、よりをするなら、おそらく認識してコマンドをすることができます。
Working with Variables 作業を変数
A variable is simply a common value that is used often enough by the shell that it is stored with a name.変数は、単に、共通の価値は十分にしばしば使われることが格納されたシェルの名を入力します。 An example of such a variable is PATH, which stores a list of directories that should be searched when a user enters a command.の例をこのような変数がパスを格納するディレクトリのリストをばならないことがコマンドを入力する場合は、ユーザーが検索します。 To refer to the contents of a variable, prefix a $ sign before the name of the variable.を参照するには、変数の内容を、接頭辞を$サインする前に、変数の名前をします。 For example, the command echo $PATH displays the content of the current search path that Bash is using.たとえば、次のコマンドを表示しますecho $パスの内容をbashの弱点は、現在の検索パスを使用しています。
On any Linux system, you’ll get quite a few variables automatically.任意のLinuxシステムを併用することでかなりの数の変数を自動的に起動します。 For an overview of all of them, you can use the env (short for environment) command.のすべてのそれらの概要については、使用することができます環境(ショート環境)コマンドを使用します。
Normally, as a user, you’ll get your variables automatically when logging in to the system.通常、あなたは、ユーザとして、お客様の変数を買ってあげるときに、自動的にシステムにログインしてください。 The most important source of new variables is the /etc/profile file, a script that is processed for every user who logs in to the system.最も重要なソースの新しい変数は、 / etc / profileファイルは、処理するには、スクリプトでは、すべてのユーザーwhoログに記録するには、システムです。 Want to add a new variable?新しい変数を追加するにしたいですか? Add it to the bottom of the /etc/profile file to make sure it is available for all users.底部に追加するには、 / etc / profileをファイルを確認するためには、すべてのユーザーにご利用いただけます。
Working with Bash History 作業をbashの履歴
Another useful feature of the Bash shell is the history feature, which remembers and lets you reuse commands you have recently used.別の有用な機能は、 bashシェルは、履歴機能、これを使用すると覚えては、最近使用されるコマンドを再利用します。 By default, the last 1,000 commands are remembered.デフォルトでは、最終更新1000コマンドが記憶されます。 This feature is useful for sessions beyond even the current one.この機能はお役にたちましたさえ、現在の1つのセッションを超えています。 A file, named .bash_history, is created in the home directory of every user, and this file records the last 1,000 commands that that user has entered.ファイルは、名前の。 bash_historyは、ホームディレクトリに作成されたすべてのユーザー、およびこのファイルのレコードの最後の1000コマンドていることをユーザーが入力します。 You can see an overview of these commands by typing history at the Bash prompt.の概要を参照することができますこれらのコマンドを入力履歴は、 bashのプロンプトを起動します。
This is where the history feature becomes especially useful because you can reissue any command from this list without typing it all over again.これには、履歴機能が特に有用ため、再発行することができます。このリストから任意のコマンドを入力することをすべてやり直す。 If you want to run any of the listed (and numbered) commands again, simply type its number preceded by an exclamation mark.のいずれかを実行する場合は、上場(および番号)コマンドを再度、単にそのコードのタイプの前に感嘆符です。 In this example, typing !5 would run aptitude show xen-source-2.6.16 again.この例では、タイピング! 5 aptitudeの詳細はXenを実行するソース- 2.6.16てください。 In addition to the history command, you can also use the up/down arrow keys, page up/down keys, and Ctrl+p/Ctrl+n to browse the history.に加えて、歴史のコマンドを使用することも、アップ/ダウン矢印キー、ページアップ/ダウンキー、またはCtrl +ページビュー数/ Ctrl + Nキーの履歴を参照してください。
A user can also erase his or her history by using the history command.ユーザーが自分の履歴を消去することもの歴史を使用してコマンドを実行します。 The most important option offered by this Bash internal command is the option -c, which clears the history list for that user.最も重要なオプションが提供され、このbashの内部コマンドのオプション- Cで、そのユーザーの履歴リストをクリアします。 This is especially useful because everything that a user types at the command line—such as passwords—is recorded.これは特に有用なため、すべてのことで、ユーザーの種類には、コマンドラインのパスワード-などが記録されます。 So use history -c to make sure your history is cleared if you’d rather not have others knowing what you’ve been up to. - cを使用するので履歴を確認してください履歴をクリアするのにはむしろない場合に他人を知って何をされています。 Once using this option, however, you can’t use the arrow up key to access previous commands, because those are all erased.一度、このオプションを使用して、しかし、アップすることはできません。矢印キーを使用して前のコマンドにアクセスするため、それらはすべて消去されます。 Because everything you enter from the command line is saved, I recommend never typing a plain-text password in the first place, even if you regularly erase the history.を入力するためのコマンドラインから、すべてが保存さは、決してお勧めプレーンテキストのパスワードを入力して、最初の開催地、たとえの歴史を定期的に消去します。 The commands that do require you to enter a password will prompt you anyway if you don't enter one right away.のコマンドを入力することでパスワードを要求するプロンプトが表示さは、とにかく1つずつ入力していない場合はすぐにします。
Source of Information : Apress Beginning Ubuntu Server Administration 情報源: apress初めubuntuサーバーの管理
Written by magakos. magakos書かれた。 Read more great feeds at is source 続きを読む大きなフィードでは、ソース WEBSITE ウェブサイト
no comments コメントはありません . です。
Read more articles on 続きを読むの記事を Ubuntu Linux UbuntuのLinux and および otherSoftware othersoftware . です。
- [+] Digg [ + ]いる : Feature this article :機能この記事は
- [+] Del.icio.us [ + ] del.icio.us : Bookmark this article :ブックマークこの記事
- [+] Furl [ + ]畳む : Bookmark this article :ブックマークこの記事















