6 examples for echo

11
1
2
3
4
5
6
7
8
9
10
11
12
13
  #the echo command outputs the result of what it receive as input
echo "hello bro!"
> hello bro!
 
#this output can be a command be the result of a command, for example 'pwd' to output the Present Working Directory
echo $(pwd)
> /path/to/the/present/working/directory
 
#this could be useful to log stuff in a document, using '>' or '>>' : hereafter, the commands add the pwd to a document
echo $(pwd) >> ~/logs/logingmypwd
 
#it can also have colors!! using the -e option and colors codes
echo -e "\e[0;32mHello This Text is Green!![0mBut This Text Isn't"
4
1
2
  # Execute command at give time
echo "ls -l" | at midnight
3
1
2
3
4
5
  # print the shell environment variable 'home' to standard output
echo $HOME
 
# apend 'bro' (newline) to the end of bro.txt, create the file if !exists
echo 'bro' >> bro.txt
2
1
2
  # print a sequence of numbers to the terminal
echo {2005..2015}
1
1
2
  # Print random number between 0 and 100, inclusive
echo $((RANDOM%100))
-15
1
2
  # Show some ascii boobs
echo '( . Y . )'