├── icon.png ├── content ├── en │ ├── man.md │ ├── rmdir.md │ ├── unlink.md │ ├── whoami.md │ ├── date.md │ ├── kill.md │ ├── head.md │ ├── whereis.md │ ├── which.md │ ├── find.md │ ├── ln.md │ ├── traceroute.md │ ├── passwd.md │ ├── sudo.md │ ├── chown.md │ ├── pwd.md │ ├── echo.md │ ├── tail.md │ ├── cat.md │ ├── mv.md │ ├── touch.md │ ├── cp.md │ ├── rm.md │ ├── cd.md │ ├── mkdir.md │ ├── ls.md │ └── chmod.md └── pt-br │ ├── man.md │ ├── whoami.md │ ├── date.md │ ├── unlink.md │ ├── rmdir.md │ ├── whereis.md │ ├── kill.md │ ├── head.md │ ├── which.md │ ├── find.md │ ├── ln.md │ ├── traceroute.md │ ├── sudo.md │ ├── passwd.md │ ├── chown.md │ ├── echo.md │ ├── pwd.md │ ├── tail.md │ ├── cat.md │ ├── mv.md │ ├── cp.md │ ├── rm.md │ ├── touch.md │ ├── cd.md │ ├── mkdir.md │ ├── ls.md │ └── chmod.md ├── CONTRIBUTING.md └── README.md /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledge-club/bash/HEAD/icon.png -------------------------------------------------------------------------------- /content/en/man.md: -------------------------------------------------------------------------------- 1 | ## MAN 2 | 3 | Shows the full description of a command. 4 | 5 | ```sh 6 | # Shows help for `cat` command 7 | man cat 8 | ``` -------------------------------------------------------------------------------- /content/en/rmdir.md: -------------------------------------------------------------------------------- 1 | ## RMDIR 2 | 3 | Removes an empty directory. 4 | 5 | ```sh 6 | # Removes newly created folder "fdr" 7 | rmdir fdr 8 | ``` -------------------------------------------------------------------------------- /content/en/unlink.md: -------------------------------------------------------------------------------- 1 | ## UNLINK 2 | 3 | Removes a single file 4 | 5 | ```sh 6 | # Deletes file "the_file.md" 7 | unlink the_file.md 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/man.md: -------------------------------------------------------------------------------- 1 | ## MAN 2 | 3 | Mostra o manual de um comando. 4 | 5 | ```sh 6 | # Mostra o manual do comando `cat` 7 | man cat 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/whoami.md: -------------------------------------------------------------------------------- 1 | ## WHOAMI 2 | 3 | O comando `whoami` retorna seu username. 4 | 5 | ```sh 6 | # Mostra seu username 7 | whoami 8 | ``` -------------------------------------------------------------------------------- /content/en/whoami.md: -------------------------------------------------------------------------------- 1 | ## WHOAMI 2 | 3 | The `whoami` command returns your username. 4 | 5 | ```sh 6 | # Outputs your username 7 | whoami 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/date.md: -------------------------------------------------------------------------------- 1 | ## DATE 2 | 3 | O comando `date` retorna a data e hora atual. 4 | 5 | ```sh 6 | # Mostra a data e hora atual 7 | date 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/unlink.md: -------------------------------------------------------------------------------- 1 | ## UNLINK 2 | 3 | Remove um único arquivo 4 | 5 | ```sh 6 | # Deleta o arquivo "the_file.md" 7 | unlink the_file.md 8 | ``` -------------------------------------------------------------------------------- /content/en/date.md: -------------------------------------------------------------------------------- 1 | ## DATE 2 | 3 | The `date` command returns the current date and time 4 | 5 | ```sh 6 | # Outputs current date and time 7 | date 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/rmdir.md: -------------------------------------------------------------------------------- 1 | ## RMDIR 2 | 3 | Apaga um diretório vazio 4 | 5 | ```sh 6 | # Apaga a pasta fdr, desde que esta esteja vazia 7 | rmdir fdr 8 | ``` -------------------------------------------------------------------------------- /content/en/kill.md: -------------------------------------------------------------------------------- 1 | ## KILL 2 | 3 | Send a signal to a process for it to finish or be killed. 4 | 5 | ```sh 6 | # Kills process with ID 342 7 | kill -9 342 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/whereis.md: -------------------------------------------------------------------------------- 1 | ## WHEREIS 2 | 3 | Usado para localizar programas no sistema. 4 | 5 | ```sh 6 | # localiza o programa php no sistema 7 | whereis php 8 | ``` -------------------------------------------------------------------------------- /content/en/head.md: -------------------------------------------------------------------------------- 1 | ## HEAD 2 | 3 | The oposite of `tail`, gets the first part of a file. 4 | 5 | ```sh 6 | # Gets the first lines of error.log 7 | head error.log 8 | ``` -------------------------------------------------------------------------------- /content/en/whereis.md: -------------------------------------------------------------------------------- 1 | ## WHEREIS 2 | 3 | Used to localize programs within the filesystem. 4 | 5 | ```sh 6 | # Locate program php within the filesystem 7 | whereis php 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/kill.md: -------------------------------------------------------------------------------- 1 | ## KILL 2 | 3 | Envia um sinal para o processo para finalizá-lo ou matá-lo. 4 | 5 | ```sh 6 | # Mata o process process de ID 342 7 | kill -9 342 8 | ``` -------------------------------------------------------------------------------- /content/en/which.md: -------------------------------------------------------------------------------- 1 | ## WHICH 2 | 3 | Same as _WHEREIS_ but locate programs inside the user's path. 4 | 5 | ```sh 6 | # Locate program php within the users path 7 | which php 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/head.md: -------------------------------------------------------------------------------- 1 | ## HEAD 2 | 3 | O contrário de `tail`, pega a parte inicial de um arquivo. 4 | 5 | ```sh 6 | # Pega as primeias linhas do error.log 7 | head error.log 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/which.md: -------------------------------------------------------------------------------- 1 | ## WHICH 2 | 3 | Igual ao `WHEREIS`, mas localiza programas somente pro seu usário. 4 | 5 | ```sh 6 | # Localiza o programa php, no seu usuário 7 | which php 8 | ``` -------------------------------------------------------------------------------- /content/en/find.md: -------------------------------------------------------------------------------- 1 | ## FIND 2 | 3 | Searches a specific directory for a pattern. 4 | 5 | ```sh 6 | # Finds the git directory recursively within a root folder 7 | find . -name .git -type d 8 | ``` -------------------------------------------------------------------------------- /content/en/ln.md: -------------------------------------------------------------------------------- 1 | ## LN 2 | 3 | Creates links between files, can be seen as "shortcuts" of Windows users. 4 | 5 | ```sh 6 | # Creates a "Shortcut" to file /bin/ls 7 | ln -s ./list /bin/ls 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/find.md: -------------------------------------------------------------------------------- 1 | ## FIND 2 | 3 | Procura em um diretório específico pelo padrão citado. 4 | 5 | ```sh 6 | # procura pela pasta .git recursiviamente dentro do hd 7 | find . -name .git -type d 8 | ``` -------------------------------------------------------------------------------- /content/en/traceroute.md: -------------------------------------------------------------------------------- 1 | ## TRACEROUTE 2 | 3 | Traces the internet route of a domain or IP (equivalent to `tracert` on Windows) 4 | 5 | ```sh 6 | # Traces the route to domain.com 7 | traceroute domain.com 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/ln.md: -------------------------------------------------------------------------------- 1 | ## LN 2 | 3 | Cria link entre arquivos, pode ser visto como um "atalho" para o usuários Windows. 4 | 5 | ```sh 6 | # Cria um "atalho" para o arquivo /bin/ls 7 | ln -s ./list /bin/ls 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/traceroute.md: -------------------------------------------------------------------------------- 1 | ## TRACEROUTE 2 | 3 | Traça a rota de internet de um domínio ou IP (equivalente a `tracert` no Windows) 4 | 5 | ```sh 6 | # Verifica a rota para o domain.com 7 | traceroute domain.com 8 | ``` -------------------------------------------------------------------------------- /content/en/passwd.md: -------------------------------------------------------------------------------- 1 | ## PASSWD 2 | 3 | The `passwd` command is used to change your password. 4 | 5 | ```sh 6 | # You will be asked to type your current password and after this you have to type your new password twice 7 | passwd 8 | ``` -------------------------------------------------------------------------------- /content/en/sudo.md: -------------------------------------------------------------------------------- 1 | ## SUDO 2 | 3 | Grants `root` privileges to the current command. 4 | 5 | ```sh 6 | # Runs ls command as root 7 | sudo ls 8 | ``` 9 | 10 | ```sh 11 | # Change the current user to root 12 | sudo su 13 | ``` -------------------------------------------------------------------------------- /content/pt-br/sudo.md: -------------------------------------------------------------------------------- 1 | ## SUDO 2 | 3 | Dá acesso `root` ao comando em uso. 4 | 5 | ```sh 6 | # Roda o comando ls command como administrador 7 | sudo ls 8 | ``` 9 | 10 | ```sh 11 | # Muda o usuário para administrador 12 | sudo su 13 | ``` -------------------------------------------------------------------------------- /content/en/chown.md: -------------------------------------------------------------------------------- 1 | ## CHOWN 2 | 3 | Comes from _change owner_. It can change file/folder owners and groups. 4 | 5 | ```sh 6 | # Changes the owner of the file called `file.md` to `wheel` and the group to `root` 7 | chown wheel:group file.md 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/passwd.md: -------------------------------------------------------------------------------- 1 | ## PASSWD 2 | 3 | O comando `passwd` é usado para mudar sua senha de usuário. 4 | 5 | ```sh 6 | # Você será solicitado a digitar sua senha atual e em seguida, você tem que digitar a sua nova senha duas vezes 7 | passwd 8 | ``` -------------------------------------------------------------------------------- /content/pt-br/chown.md: -------------------------------------------------------------------------------- 1 | ## CHOWN 2 | 3 | Vem de `change owner`, significa mudar dono. Pode mudar o dono ou grupo ao qual um arquivo pertence. 4 | 5 | ```sh 6 | # Muda o dono de um arquivo chamado `file.md` para `wheel` e o grupo para `root`. 7 | chown wheel:group file.md 8 | ``` -------------------------------------------------------------------------------- /content/en/pwd.md: -------------------------------------------------------------------------------- 1 | ## PWD 2 | 3 | Show where you are in bash. The directory specifically. The command is an abbreviation to ***print working directory***. 4 | 5 | ```sh 6 | pwd 7 | ``` 8 | 9 | will return a path like this 10 | 11 | ```sh 12 | /Users/darlanmendonca/projects 13 | ``` -------------------------------------------------------------------------------- /content/en/echo.md: -------------------------------------------------------------------------------- 1 | ## ECHO 2 | 3 | Prints out the arguments to standard output. 4 | 5 | Echo is often used to pass on parameters to other commands' inputs, since it writes out to standard output, its output can be piped to another command's input stream. 6 | 7 | ```sh 8 | # Prints "Hello" to the screen 9 | echo "Hello" 10 | ``` -------------------------------------------------------------------------------- /content/pt-br/echo.md: -------------------------------------------------------------------------------- 1 | ## ECHO 2 | 3 | Mostra na tela algo. 4 | 5 | Eco é frequentemente usado para passar parâmetros para as entradas de outros comandos, uma vez que ele escreve para a saída padrão, sua saída pode ser canalizada para outro fluxo de entrada de comando. 6 | 7 | ```sh 8 | # mostra "Hello" na tela 9 | echo "Hello" 10 | ``` -------------------------------------------------------------------------------- /content/pt-br/pwd.md: -------------------------------------------------------------------------------- 1 | ## PWD 2 | 3 | Mostra onde você está no bash. O diretório especificamente. O comando é uma abreviação para `print working directory`, em português algo como `mostrar diretório corrente`. 4 | 5 | ```sh 6 | pwd 7 | ``` 8 | 9 | irá retornar um path similar ao exemplo abaixo 10 | 11 | ```sh 12 | /Users/darlanmendonca/projects 13 | ``` -------------------------------------------------------------------------------- /content/pt-br/tail.md: -------------------------------------------------------------------------------- 1 | ## TAIL 2 | 3 | Pega o conteúdo final de um arquivo e mostra ele na tela. 4 | 5 | ```sh 6 | # Pega as últimas linhas do arquivo error.log 7 | tail error.log 8 | ``` 9 | 10 | Também é possível ler um stream de dados em tempo real, exemplo, ler os logs do apache em tempo real, enquanto o server está executando. 11 | 12 | ```sh 13 | tail -f apache/error.log 14 | ``` -------------------------------------------------------------------------------- /content/en/tail.md: -------------------------------------------------------------------------------- 1 | ## TAIL 2 | 3 | Gets the ending content of a file and prints it out to the screen. 4 | 5 | ```sh 6 | # Get the ending lines of error.log 7 | tail error.log 8 | ``` 9 | 10 | There's also a possibility to read a stream of data in realtime, for instance, to read the apache error logs in real time while the server is executing. 11 | 12 | ```sh 13 | tail -f apache/error.log 14 | ``` -------------------------------------------------------------------------------- /content/pt-br/cat.md: -------------------------------------------------------------------------------- 1 | ## CAT 2 | 3 | Mostra o conteúdo de um arquivo, ou arquivos. 4 | 5 | `cat` irá sequencialmente ler e concatenarr o conteúdo dos arquivos solicitados, e mostrar. 6 | 7 | ```sh 8 | # Lê e mostra o conteúdo do arquivo .gitignore 9 | cat .gitignore 10 | ``` 11 | 12 | ```sh 13 | # Lê e mostra o conteúdo de múltiplos arquivos 14 | cat .gitignore .bowerrc .babelrc yourfile.css 15 | ``` -------------------------------------------------------------------------------- /content/en/cat.md: -------------------------------------------------------------------------------- 1 | ## CAT 2 | 3 | Display contents of a file, or files. 4 | 5 | `cat` will sequentially read and concatenate the contents of the input filenames and output them to stdout. 6 | 7 | ```sh 8 | # Read and display contents of .gitignore file 9 | cat .gitignore 10 | ``` 11 | 12 | ```sh 13 | # Read and displays the contents of multiple files 14 | cat .gitignore .bowerrc .babelrc yourfile.css 15 | ``` -------------------------------------------------------------------------------- /content/en/mv.md: -------------------------------------------------------------------------------- 1 | ## MV 2 | 3 | Moves or renames a file. 4 | 5 | - If another directory is specified, then the file will be moved acording to the argument 6 | - If the same directory is specified, but another filename, the file will be renamed 7 | 8 | ```sh 9 | # Moving file "a.txt" to "/b" directory 10 | mv a.txt /b/a.txt 11 | ``` 12 | 13 | ```sh 14 | # Renames file "a.txt" to "b.txt" 15 | mv a.txt b.txt 16 | ``` 17 | 18 | ```sh 19 | # Renames file "file.txt" to "file with spaces.txt" 20 | mv file.txt file\ with\ spaces.txt 21 | ``` 22 | -------------------------------------------------------------------------------- /content/en/touch.md: -------------------------------------------------------------------------------- 1 | ## TOUCH 2 | 3 | This command is used to create files. 4 | 5 | ```sh 6 | # create a file called index.html 7 | touch index.html 8 | ``` 9 | 10 | ```sh 11 | # create files index.html, style.css and app.js in just one command 12 | touch index.thml style.css app.js 13 | ``` 14 | 15 | ```sh 16 | # to create a file with spaces on name, use "\ "(slash-space) 17 | # create a file named "file spaces.txt" 18 | touch file\ spaces.txt 19 | ``` 20 | 21 | ```sh 22 | # or just use single or double quotes 23 | mkdir 'file spaces.txt' 24 | ``` -------------------------------------------------------------------------------- /content/en/cp.md: -------------------------------------------------------------------------------- 1 | ## CP 2 | 3 | Copies a file to another location. 4 | 5 | ```sh 6 | # Copies the file "file.md" to the folder "files"" 7 | cp file.md /files/ 8 | ``` 9 | 10 | Can also be used to create a copy of files in the `pwd` if you specify a __file__ name and not a __folder__ name. 11 | 12 | ```sh 13 | # Creates a second file called "b.md" from "a.md" 14 | cp a.md b.md 15 | ``` 16 | 17 | ```sh 18 | # Copy all files from ~/some_folder to ~/Documents/another_folder" 19 | # You're in ~/some_folder 20 | cp * ~/Documents/another_folder 21 | ``` 22 | -------------------------------------------------------------------------------- /content/pt-br/mv.md: -------------------------------------------------------------------------------- 1 | ## MV 2 | 3 | Move ou renomeia um arquivo 4 | 5 | - Se outro diretório é especificado, então o arquivo será movido de acordo com o argumento 6 | - Se é no mesmo diretório, mas outro nome, o arquivo será renomeado 7 | 8 | ```sh 9 | # Move o arquivo "a.txt" para a pasta "/b" 10 | mv a.txt /b/a.txt 11 | ``` 12 | 13 | ```sh 14 | # Renomeia o arquivo "a.txt" para "b.txt" 15 | mv a.txt b.txt 16 | ``` 17 | 18 | ```sh 19 | # Renomeia o arquivo "titulo.txt" para "titulo com espaços.txt" 20 | mv titulo.txt titulo\ com\ espaços.txt 21 | ``` 22 | -------------------------------------------------------------------------------- /content/en/rm.md: -------------------------------------------------------------------------------- 1 | ## RM 2 | 3 | Means remove, is used to delete files or directories. **But be careful, this command dont send file to trash**, they delete and dont have how undo. 4 | 5 | ```sh 6 | # delete a file called index.html in current directory 7 | rm index.html 8 | ``` 9 | 10 | ```sh 11 | # delete multiples files in a single command 12 | rm index.html style.css 13 | ``` 14 | 15 | ```sh 16 | # finally to delete a directory, you need use flags r and f, respectively, both are abbreviation to recursive and force 17 | rm -rf app 18 | ``` -------------------------------------------------------------------------------- /content/pt-br/cp.md: -------------------------------------------------------------------------------- 1 | ## CP 2 | 3 | Copia o arquivo para um nova localização. 4 | 5 | ```sh 6 | # Copia o arquivo "file.md" para a pasta "files"" 7 | cp file.md /files/ 8 | ``` 9 | 10 | Pode também ser usado para criar uma cópia dos arquivos no `pwd` se você especificar um nome de arquivo e não um nome de pasta. 11 | 12 | ```sh 13 | # Cria um segundo arquivo chamado "b.md" do "a.md" 14 | cp a.md b.md 15 | ``` 16 | 17 | ```sh 18 | # Copia todos os arquivos de ~/alguma_pasta para ~/Documents/outra_pasta" 19 | # Você está em ~/alguma_pasta 20 | cp * ~/Documents/outra_pasta 21 | ``` 22 | -------------------------------------------------------------------------------- /content/pt-br/rm.md: -------------------------------------------------------------------------------- 1 | ## RM 2 | 3 | Significar `remover`, é usado para deletar arquivos ou diretórios. **Mas cuidado, este comando não envia para lixeira**, ele deleta o arquivo e não tem como voltar. 4 | 5 | ```sh 6 | # remove o arquivo chamado index.html na pasta atual 7 | rm index.html 8 | ``` 9 | 10 | ```sh 11 | # remove múltiplos arquivos em um único comando 12 | rm index.html style.css 13 | ``` 14 | 15 | ```sh 16 | # finalmente, para remover um diretório, você precisa usar as flags `r` e `f`, respectivamente, são abreviações para `recursive` e `force` 17 | rm -rf app 18 | ``` -------------------------------------------------------------------------------- /content/pt-br/touch.md: -------------------------------------------------------------------------------- 1 | ## TOUCH 2 | 3 | Este comando é usado para criar arquivos. 4 | 5 | ```sh 6 | # cria o arquivo com nome index.html 7 | touch index.html 8 | ``` 9 | 10 | ```sh 11 | # cria os arquivos index.html, style.css and app.js em apenas um comando 12 | touch index.thml style.css app.js 13 | ``` 14 | 15 | ```sh 16 | # para criar um arquivo com espaços no nome, use "\ "(barra invertida-espaço) 17 | # cria um arquivo chamado "nome com espaço.txt" 18 | touch nome\ com\ espaço.txt 19 | ``` 20 | 21 | ```sh 22 | # ou apenas use aspas simples ou duplas 23 | mkdir 'nome com espaço.txt' 24 | ``` 25 | -------------------------------------------------------------------------------- /content/en/cd.md: -------------------------------------------------------------------------------- 1 | ## CD 2 | 3 | Go to a path, relative or absolute. Is an abbreviation to ***change directory*** 4 | 5 | ```sh 6 | # '/'' is a root of HD in unix systems (Linux, MacOS, ...). Similar to 'c:' if yo're in a Windows. 7 | cd / 8 | ``` 9 | 10 | Another example 11 | 12 | ```sh 13 | # '~'' is an alias to user's directory in unix systems. The complete path is anything like '/Users/darlanmendonca' 14 | cd ~ 15 | ``` 16 | 17 | ```sh 18 | # path absolute 19 | cd /Users/darlanmendonca 20 | ``` 21 | 22 | ```sh 23 | # relative path, I'm in /Users/darlanmendonca, and we want enter in directory projects, inside where we're. 24 | cd projects 25 | ``` 26 | 27 | ### Note 28 | 29 | com espaço após o comando, você consegue passar múltiplos argumentos ao comando. No caso do comando `cd`, você só precisa passar um argumento, mas outros comando talvez trabalhem com múltiplos. No caso de múltiplos argumentos, apenas dê espaço entre os valores. -------------------------------------------------------------------------------- /content/pt-br/cd.md: -------------------------------------------------------------------------------- 1 | ## CD 2 | 3 | Vai para um diretório, relativo ou absoluto. É uma abreviação de `change directory`, em português `mudar diretório` 4 | 5 | ```sh 6 | # '/'' é a raiz do HD em sistemas baseados em Unix (Linux, MacOS, ...). Similar a 'c:' se você estiver no Windows. 7 | cd / 8 | ``` 9 | 10 | Outro exemplo 11 | 12 | ```sh 13 | # '~'' é um alias para a pasta de usuário em sistemas baseados em Unix O path completo seria algo como '/Users/darlanmendonca' 14 | cd ~ 15 | ``` 16 | 17 | ```sh 18 | # path absoluto 19 | cd /Users/darlanmendonca 20 | ``` 21 | 22 | ```sh 23 | # path absoluto, Eu estou em /Users/darlanmendonca, e nós queremos entrar no diretório projetos, que está dentro do diretório atual. 24 | cd projects 25 | ``` 26 | 27 | ### Nota 28 | 29 | with space after command, you can pass multiples arguments to command. In case of ***cd*** command, you only need pass one arguments, but other commands maybe work with multiples. In cases of multiples arguments, just give a space between values. -------------------------------------------------------------------------------- /content/en/mkdir.md: -------------------------------------------------------------------------------- 1 | ## MKDIR 2 | 3 | Command to ***make a directory***. 4 | 5 | ```sh 6 | # create a directory called 'nomeDaPasta' in current path 7 | mkdir nomeDaPasta 8 | ``` 9 | 10 | ```sh 11 | # create two or more directorys, just give space between arguments. 12 | # in this case, we are create two directory, 'name1' and 'name2', both in the current path. 13 | mkdir name1 name2 14 | ``` 15 | 16 | ```sh 17 | # create a directory called 'test' on path '/Users/darlanmendonca/Desktop' 18 | mkdir /Users/darlanmendonca/Desktop/test 19 | ``` 20 | 21 | ```sh 22 | # -p is an flag(option), to create directories (in this case, directory 'parent'), case their not exists 23 | mkdir -p /Users/darlanmendonca/Desktop/test/parent/children 24 | ``` 25 | 26 | ```sh 27 | # if you need spaces into directory name, use "\ "(slash-space) 28 | # create a directory named "directory with spaces" 29 | mkdir directory\ with\ spaces 30 | ``` 31 | 32 | ```sh 33 | # or just use single or double quotes 34 | mkdir 'name with space' 35 | ``` 36 | -------------------------------------------------------------------------------- /content/pt-br/mkdir.md: -------------------------------------------------------------------------------- 1 | ## MKDIR 2 | 3 | Comando para fazer um diretório, abreviação de `make a directory`. 4 | 5 | ```sh 6 | # cria um diretório chamado 'nomeDaPata' na pasta atual 7 | mkdir nomeDaPasta 8 | ``` 9 | 10 | ```sh 11 | # crie dois ou mais diretórios, apenas dê espaço entre os argumentos. 12 | # neste caso, nós estamos criando dois diretórios, 'name1' e 'name2', ambos na pasta atual. 13 | mkdir name1 name2 14 | ``` 15 | 16 | ```sh 17 | # cria um diretório chamado 'test' no path '/Users/darlanmendonca/Desktop' 18 | mkdir /Users/darlanmendonca/Desktop/test 19 | ``` 20 | 21 | ```sh 22 | # -p é uma flag(option), para criar diretórios (no nosso caso, pasta 'parent'), caso estes não existam 23 | mkdir -p /Users/darlanmendonca/Desktop/test/parent/children 24 | ``` 25 | 26 | ```sh 27 | # se você precisa de espaços no nome da pasta, use "\ "(barra invertida + espaço) 28 | # criando uma pasta chamada "nome com espaços" 29 | mkdir nome\ com\ espaços 30 | ``` 31 | 32 | ```sh 33 | # ou apenas use aspas simples ou duplas 34 | mkdir 'nome com espaço' 35 | ``` 36 | -------------------------------------------------------------------------------- /content/pt-br/ls.md: -------------------------------------------------------------------------------- 1 | ## LS 2 | 3 | Significa `listar`. Útil para ver quais arquivos existem em um path/diretório atual. 4 | 5 | ```sh 6 | # Eu estou em '~', o comando abaixo lista os arquivos em meu diretório atual 7 | ls 8 | ``` 9 | 10 | ```sh 11 | # lista os arquivos em um path específico 12 | ls /Users 13 | ``` 14 | 15 | ```sh 16 | # Se você quer mostrar arquivos ocultos, use a flag -a, é uma abreviação para 'all' 17 | ls -a / 18 | ``` 19 | 20 | ```sh 21 | # útil para checar se um arquivo existe, se existir, retorna os arquivos encontrados, se não, retorna 'No cuch file or directory' 22 | ls ~/Desktop/test.js 23 | ``` 24 | 25 | ### Nota 26 | 27 | Sempre que você escrever um path para um arquivo, você pode usar glob files. Glob files, é um jeito de definir caminho para arquivos escrevendo partes do nome, entre outros mais. 28 | 29 | ```sh 30 | # lista apenas os arquivos em um path, que tenham uma extensão .js 31 | ls ~/Desktop/projeto1/*.js 32 | ``` 33 | 34 | ```sh 35 | # o dobro **, é para listar recursivamente interno a pasta projeto1 36 | ls ~/Desktop/projeto1/**/*.js 37 | ``` -------------------------------------------------------------------------------- /content/en/ls.md: -------------------------------------------------------------------------------- 1 | ## LS 2 | 3 | Means ***list***. Useful to see what files exists in a path/current directory. 4 | 5 | ```sh 6 | # I'm in '~', the command below list files in my current directory 7 | ls 8 | ``` 9 | 10 | ```sh 11 | # list files in specific path 12 | ls /Users 13 | ``` 14 | 15 | ```sh 16 | # If you want see hidden files, use the flag -a, means 'all' 17 | ls -a / 18 | ``` 19 | 20 | ```sh 21 | # useful to check if a file exists, if file exists, return files founded, if not, return 'No such file or directory' 22 | ls ~/Desktop/test.js 23 | ``` 24 | 25 | ### Note 26 | 27 | Always that you will write a path to a file, you can use glob files, to productivity. Glob files, is a way to set path to files using sets of filenames with wildcard characters. 28 | 29 | ```sh 30 | # list only files in path, that have an extension .js 31 | ls ~/Desktop/projeto1/*.js 32 | ``` 33 | 34 | ```sh 35 | # list only files in path, that have an extension .js 36 | ls ~/Desktop/projeto1/*.js 37 | ``` 38 | 39 | ```sh 40 | # the double **, is to recursevely list inside projeto1 41 | ls ~/Desktop/projeto1/**/*.js 42 | ``` -------------------------------------------------------------------------------- /content/en/chmod.md: -------------------------------------------------------------------------------- 1 | ## CHMOD 2 | 3 | Comes from _change modes_. It is used to change the access control of a file or folder in order to allow owner, users or everyone to _read/write/exec_ a file. 4 | 5 | Permissions on unix-based systems are based on bitcounts. We have 3 bits, one for read, one for write and one for exec, making it `000` (or _read write exec_), if we set `001`, by summing the bits we'll have `1` (because `001=1`), if we want to set all permissions to a file we can simply set `111` (and by summing we have `7` because the binary sum of `111` is `7`). 6 | 7 | On another part we have to set permissions for the users. The order is _owner_ _users in group_ _users not in group_, so we can have 3 sets of bits `000 000 000` which means `owner user guest`. So we can set permissions by concatenating sums of bits like `654`, this means: Owner can read-write (`110=6`), users can read and execute (`101=5`) and guests can only read (`100=4`). 8 | 9 | ```sh 10 | # Sets the permission to owner can do anything, users can read and execute and guests only read the file "permissions.txt" 11 | chmod 754 permissions.txt 12 | ``` -------------------------------------------------------------------------------- /content/pt-br/chmod.md: -------------------------------------------------------------------------------- 1 | ## CHMOD 2 | 3 | Vem de `change modes`. É usado para mudar o controle de acesso de um arquivo ou pasta na ordem para permitir o dono, usuários, ou todos para `ler/escrever/exectuar` um arquivo. 4 | 5 | Permissões em sistemas baseados em unix são baseados em bitcounts. Nós temos 3 bits, um para `read`, outro para `write` e um para `exec`, sendo `000` (ou `read write exec`), se nós setarmos `001`, pela soma dos bits teremos `1` (por que `0001=1`), se nós quisermos setar todas as permissões para um arquivo nós podemos simplesmente usar `111` (e sumando todos nós temos `7` porque a soma binária de `111` é `7`). 6 | 7 | Numa outra parte nós temos que setar as permissões para os usuários. A ordem é `owner` `users in group` `not in group`, então nós conseguimos ter 3 conjuntos de bits `000 000 000` que significa `owner user guest`. Então nós podemos setar as permissões por juntar as somas dos bites como `654`, isto signficia: Owner pode ler-escrever (`110=6`), usuários podem ler e executar (`101=5`) e guests podem apenas ler (`100=4`). 8 | 9 | ```sh 10 | # seta a permissão para owner puderem fazer qualquer coisa, usuários podem ler e executar, e guests apenas ler o arquivo "permissions.txt" 11 | chmod 754 permissions.txt 12 | ``` -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Did you like this content and want to contribute? We'd love your help! This way we'll be able to build a really relevant content, which is not only useful to beginners but for everyone! 2 | 3 | Our targets are: 4 | 5 | - Be easy to read and interpret 6 | - Write examples 7 | 8 | ### How to contribute 9 | 10 | To make easier our jobs with contributions and revisions, there's a need to be organized so we can avoid possible errors: 11 | 12 | 1. Fork the project 13 | 2. Create a branch to add your contribution 14 | 3. Add only one command and/or definition per Pull request 15 | 4. Open a pull request 16 | 17 | #### Note #### 18 | 19 | By `only one command`, we mean add only one file at a time. Each file will contain a single command and/or definition and will be part of a single PR. 20 | 21 | E.g: `rm` command should be within a `rm.md` file within the `content/` directory of the project. This file will become a single pull request. 22 | 23 | ### Organization 24 | 25 | When you add a new command, create a markdown file, i.e. `rm.md` and, in this file, you should explain the definition. 26 | The `README.md` contains only the Table of Contents, so there's no need to change that file. 27 | 28 | That is, when you contribute with a new command 29 | 30 | 1. Create a file for the command, i.e. ```rm.md```. 31 | 2. Open a Pull Request with the title "[New] your-command" 32 | 33 | That's it! Easy isn't it? 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Beginner in bash/shell-script? 4 | 5 | Below you'll find the initial list of commands you must know. 6 | 7 | - MAN [en](content/en/man.md) [pt-br](content/pt-br/man.md) 8 | - PWD [en](content/en/pwd.md) [pt-br](content/pt-br/pwd.md) 9 | - CD [en](content/en/cd.md) [pt-br](content/pt-br/cd.md) 10 | - LS [en](content/en/ls.md) [pt-br](content/pt-br/ls.md) 11 | - MKDIR [en](content/en/mkdir.md) [pt-br](content/pt-br/mkdir.md) 12 | - RM [en](content/en/rm.md) [pt-br](content/pt-br/rm.md) 13 | - RMDIR [en](content/en/rmdir.md) [pt-br](content/pt-br/rmdir.md) 14 | 15 | These commands are really important and you are going to use them all the time. 16 | After studying and understanding all of these, you can continue to learn more, see other commands: 17 | 18 | - CAT [en](content/en/cat.md) [pt-br](content/pt-br/cat.md) 19 | - CHMOD [en](content/en/chmod.md) [pt-br](content/pt-br/chmod.md) 20 | - CHOWN [en](content/en/chown.md) [pt-br](content/pt-br/chown.md) 21 | - CP [en](content/en/cp.md) [pt-br](content/pt-br/cp.md) 22 | - DATE [en](content/en/date.md) [pt-br](content/pt-br/date.md) 23 | - ECHO [en](content/en/echo.md) [pt-br](content/pt-br/echo.md) 24 | - FIND [en](content/en/find.md) [pt-br](content/pt-br/find.md) 25 | - HEAD [en](content/en/head.md) [pt-br](content/pt-br/head.md) 26 | - KILL [en](content/en/kill.md) [pt-br](content/pt-br/kill.md) 27 | - LN [en](content/en/ln.md) [pt-br](content/pt-br/ln.md) 28 | - MV [en](content/en/mv.md) [pt-br](content/pt-br/mv.md) 29 | - PASSWD [en](content/en/passwd.md) [pt-br](content/pt-br/passwd.md) 30 | - SUDO [en](content/en/sudo.md) [pt-br](content/pt-br/sudo.md) 31 | - TAIL [en](content/en/tail.md) [pt-br](content/pt-br/tail.md) 32 | - TRACEROUTE [en](content/en/traceroute.md) [pt-br](content/pt-br/traceroute.md) 33 | - TOUCH [en](content/en/touch.md) [pt-br](content/pt-br/touch.md) 34 | - UNLINK [en](content/en/unlink.md) [pt-br](content/pt-br/unlink.md) 35 | - WHEREIS [en](content/en/whereis.md) [pt-br](content/pt-br/whereis.md) 36 | - WHICH [en](content/en/which.md) [pt-br](content/pt-br/which.md) 37 | - WHOAMI [en](content/en/whoami.md) [pt-br](content/pt-br/whoami.md) 38 | 39 | Do you know any other command, or maybe a suggestion? 40 | 41 | See how to contribute [here](CONTRIBUTING.md) 42 | 43 | --------------------------------------------------------------------------------