Questions tagged as 'bash'

3
answers

Find files containing string and rename

To find files whose name contains a certain string , we can use find as follows: Sample file:    1429331804.H568641P9577.xxxx.example.com, S = 17846: 2, Command to find by xxxx.example.com : find . -type f -name "*xxx...
asked by 21.04.2015 / 23:21
2
answers

List the amount of space occupied by a file type in the terminal

I suspect that the PCs I use have many .RData files, used by the R program to save data sets. I want to do a cleanup on these files, but without going into directory by directory, from computer to computer. In addition, I use computers wi...
asked by 29.06.2017 / 15:40
2
answers

Error in build ionic framework

Gentlemen, I migrated to linux and I have a question / problem. I already have the android sdk installed with their respective dependencies installed, I squeeze the android command and open the sdk manager normally, I put the environment vari...
asked by 03.12.2016 / 17:54
3
answers

What is the $ () [dollar sign followed by parentheses] in BASH?

I have seen some code examples in BASH where $() is used to execute a command. For example: sudo chown -R $(whoami) . What does this dollar sign followed by the command encapsulated by the parenthesis, ie $(comando) ?     
asked by 05.09.2018 / 16:40
1
answer

What is the difference between reset and clear in Terminal?

No Terminal , what is the difference between the reset and clear ? I'm using Terminal of Ubuntu , and apparently the two commands clear the screen.     
asked by 02.09.2015 / 22:00
2
answers

How to define a global alias in BASH?

I'm using Terminal in Linux and I'm tired of repeating the same commands all the time. For example, I use a command almost all day, so I create an alias to make things easier. Example: alias tt="php artisan tinker --env=l...
asked by 10.05.2016 / 19:15
3
answers

What are [] in bash?

I'm starting in shell script now, and often reading other people's programs, I see the use of [] associated with if . For example: if [condition]; then fi I have also often seen use as follows: if [[condition]]; then fi...
asked by 30.08.2016 / 21:49
2
answers

Find and Replace Various Word Within a File

I want to develop a script that will replace any words in file . I know what I can do with the command (s) below: $ tr 'ABC' '123' < arquivo.txt > novo-arquivo.txt or $ sed "s/ABC/123/g" arquivo.txt > novo-...
asked by 05.10.2016 / 06:48
1
answer

What is a unary operator

Code: #!/bin/bash echo "Digite 1:" read$TESTE if [ $TESTE == 654 ] then echo "Usage: ./pingscript.sh [network]" echo "example: ./pingscript.sh 192.168.20" fi Error message: Digite 1: 321 ./z.sh: linha 5: [: ==: esperado opera...
asked by 29.04.2017 / 22:01
1
answer

How to send message to stderr in bash via echo command?

I'm writing some script to deploy an application and I need to send status messages to stderr instead of stdout , which the echo command does by default. How to do the command echo send the message to stderr instead of stdout ?...
asked by 12.11.2014 / 21:32