Sua mais melhor fonte da informação e da notícia aproximadamente winvista, janelas e excitadores no Internet

ARTIGOS de Vista ALTO 50 Vírus de Spyware Vista MACIO AJUDA de Vista

Usando o Bash efetuar melhor em Ubuntu


Bàsicamente, no ambiente do Bash, um administrador está trabalhando com comandos do texto. Um exemplo de tal comando é o ls, que pode ser usado indicar uma lista das limas em um diretório. O Bash tem algumas características úteis para fazer trabalhar com estes a linha comandos tão fáceis como possível. Alguns escudos oferecem a opção terminar automaticamente um comando. O Bash tem esta característica, mas faz mais do que apenas comandos completos. O Bash pode terminar quase tudo: os comandos nao justos, mas arquivam também nomes e variáveis do escudo.


Usando a conclusão automática do comando
Usar esta característica é tão simples quanto pressionando a chave de aba. Por exemplo, a linha comando do gato é usada indicar os índices de uma lima de texto do ASCII. O nome desta lima, que está no diretório atual, é this_is_a_file. Assim, para abrir esta lima, o usuário pode datilografar o thi do gato e então pressionar a chave de aba. Se o diretório tiver somente uma lima que começa com o t-h-i das letras, o Bash termina automaticamente o nome da lima. Se o diretório tiver outras limas que começam com as mesmas letras, o Bash terminará o nome da lima tão distante quanto possível. Por exemplo, vamos dizer que há uma lima no diretório atual com o thisAlsoIsAFile this_is_a_text_file e outro nomeado conhecido. Porque ambas as limas começam com o texto esta, o Bash terminará somente até este e não mais mais. Para indicar uma lista das possibilidades, você pressiona então a chave de aba outra vez. Isto permite que você incorpore manualmente mais informação. Naturalmente, você pode então usar a chave de aba outra vez usar uma vez a característica da conclusão mais.

Trabalhar com a chave de aba faz realmente a linha relação do comando muito mais fácil. Imagine que você necessita controlar volumes lógicos em seu usuário e você recorda somente que o comando para aquele começa com lv. Neste caso, você pode datilografar o lv e pressionar a chave de aba duas vezes. O resultado será uma lista agradável de todos os comandos que começam com lv, de que você reconhecerá provavelmente o comando que você necessita.


Trabalhar com variáveis
Uma variável é simplesmente um valor comum que seja usado frequentemente bastante pelo escudo que está armazenado com um nome. Um exemplo de tal variável é o TRAJETO, que armazena uma lista dos diretórios que devem ser procurarados quando um usuário incorpora um comando. Para consultar aos índices de uma variável, prefixe um sinal de $ antes do nome da variável. For example, the command echo $PATH displays the content of the current search path that Bash is using.
On any Linux system, you’ll get quite a few variables automatically. 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. 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.


Working with Bash History
Another useful feature of the Bash shell is the history feature, which remembers and lets you reuse commands you have recently used. By default, the last 1,000 commands are remembered. This feature is useful for sessions beyond even the current one. 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. You can see an overview of these commands by typing history at the Bash prompt.

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. 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.

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. 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. 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.

Source of Information : Apress Beginning Ubuntu Server Administration
Popularity: 1%


Written by magakos. Read more great feeds at is source WEBSITE
no comments.
Read more articles on Ubuntu Linux and otherSoftware.

Related articles

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .