11:59:38 PM
Wednesday
Sep 08
Su M Tu W Th F Sa
567891011
12131415161718
19202122232425
262728293012
3456789

Play My Typing Game

View Some of My Artwork

Writing Output
You can output text to the terminal window using echo

$ echo Please wait...
Please wait...
$


without quotes, whitespace is lost

$ echo this     was     very    widely     spaced
this was very widely spaced
$


using quotes will preserve spacing

$ echo "this     was     very    widely     spaced"
this was very widely spaced
$

OR
$ echo 'this     was     very    widely     spaced'
this was very widely spaced
$


By using single quotes, the shell is told explicity not to interfere with the string at all. If you use double quotes, some shell substitutions will take place (variable and tilde expansions and command substitutions), but since there are none in this example, the shell has nothing to change. When in doubt, use the single quotes.

Writing Output To File

$ echo this is an example
this is an example
$ echo this is an example > file.txt
$
$ cat file.txt
this is an example
$



Saving Output from the ls Command

$ ls
a.out cong.txt def.conf file.txt more.txt
$


But when we save the output using >, we get this:
$ ls > /tmp/save.out
$ cat /tmp/save.out
a.out
cong.txt
def.conf
file.txt
more.txt
$


We could have the original style of output using the -C option
$ ls -C > /tmp/save.out
$ cat /tmp/save.out
a.out cong.txt def.conf file.txt more.txt
$


Alternatively, you could use the -1 (negative one) option on ls when we don't redirect to file then we get output like this:
$ ls -1
a.out
cong.txt
def.conf
file.txt
more.txt
save.out
$


For more information on ls, read the manual by typing: man ls


Read Previous:
ls in detail
Read Next:
.htaccess - prevent hot linking of images and other file types
Table of Contents


Give a listen to my music...
My Best Recordings
How my services and skills can help you:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local
    • Most all the above, but also:
      • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
      • Recording Live Music Audio
      • Video Streaming live music and other live events anywhere that can provide wifi
      • Training Video Streaming to your venue's trusted soundperson
Skills:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local, Most all the above, but also:
    • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
    • Being your venue's soundman
    • Video Streaming live music and other live events anywhere that can provide wifi
    • Training Video Streaming to your venue's trusted soundperson