EggXpert

The official Newegg tech support community and Newegg tech support forums. Learn about PC building, case mods, computer repairs, and computer troubleshooting. Get help from knowledgable community members about computer hardware and computer software, laptops, notebooks, netbooks, consumer electronics & mp3 players, home networking, lcd TVs, home audio and more.
Welcome to eggXpert.com. Sign in | Join | Help
in Search
Advanced Search

linux command questions

Last post by . replies.
Sort Posts: Previous Next
  •  02-10-2008, 11:58 AM 263972

    linux command questions

    Hey everyone.. I am taking a linux class at school and being a windows user makes it hard to understand certain concepts.. I have a couple questions hopefully someone can make them easy for me to understand... We are talking about commands and using the echo command... what does this exactly do, I know it like prints what you write to the screen or terminal but i don't really undestand... for example one command we talk about is echo $USER of $HOME... can some try to explain the whole echo concept... another question is what is the significance of the $, if there is any.. lastly does anyone have any good books or websites for beginners to help understand the terminal and commands... thanks soo much

    case - Cooler Master Cosmos S
    hd - WD Cavier 640 GB
    hs - xigmatek 120mm Rifle
    ram - OCZ platinum 4GB DDr2 1066
    vc - Asus 4850
    mb - Gigabyte GA x48 DS4
    cpu - C2D e8500 wolfdale 3.16
  •  02-10-2008, 12:23 PM 263988 in reply to 263972

    Re: linux command questions

    http://lowfatlinux.com/linux-echo-command.html

    This explains a lot about it :

     

     

    The echo command displays a message on the screen and is primarily useful for programmers writing shell scripts (see "Linux Programming"). But anyone can use echo to show the value of environment variables. The echo command displays a message on the screen and is primarily useful for programmers writing shell scripts (see "Linux Programming"). But anyone can use echo to show the value of environment variables. Here are some examples:

    echo $PATH
    /usr/bin:/usr/local/bin
    echo My name is $USER - Home directory=$HOME.
    My name is hermie - Home directory=/home/hermie.

    The echo command is very similar to the DOS command of the same name, except that the DOS echo command cannot display environment variables--it just displays a message.

  •  02-10-2008, 12:27 PM 263994 in reply to 263972

    Re: linux command questions

    echo is a program used to show text. It can echo back what you type, or it can echo things such as environment variables ($HOME, $USER is an environment variable). Echo can also be used to pipe text to another program. For example:

    echo hello world | wall  

    the | symbol is a pipe. In the most basic sense it is like saying "take the text hello world and send it to wall"

    $HOME, $USER is a variable. It contains information. In order to access the contents of the variable you have to use the $ symbol. 

    If you wanted to, you can say just $HOME and then press enter, but you will be given an error, and that's not a very good idea either. Because without echo what you type on the shell will be interpreted as a command, or other things.... which I won't get into because I'll just confuse you even more.

    So when you want to show text, you can use echo. If you want to send text to a file. You say echo "hello world" > my_file_name 

    Again, without using echo here, "hello world" will be interpreted as a command.  The > symbol is used to redirect the text of "hello world" to a file.

    You should also type 'man echo' without the quotes the next time you're in linux. The program 'man' will show you the manual of echo, the manuals can be a bit complicated to read, but you will get used to them. :)

    A good beginners guide: 

    http://www.linux.org/lessons/beginner/index.html 

    good luck and have fun  

     EDIT:

    Btw, you can type the command 'env' to show all of your environment variables. That is where $HOME and $USER is.

    You should get a Live linux cd such as knoppix, you don't need to install it to your HD. It will run from your DVD/CD drive. The best way to learn linux is to use it, use it often, and read the man pages to find out what stuff does. 

  •  02-10-2008, 7:04 PM 264260 in reply to 263994

    Re: linux command questions

    dhthwy:

    echo is a program used to show text. It can echo back what you type, or it can echo things such as environment variables ($HOME, $USER is an environment variable). Echo can also be used to pipe text to another program. For example:

    echo hello world | wall  

    the | symbol is a pipe. In the most basic sense it is like saying "take the text hello world and send it to wall"

    $HOME, $USER is a variable. It contains information. In order to access the contents of the variable you have to use the $ symbol. 

    If you wanted to, you can say just $HOME and then press enter, but you will be given an error, and that's not a very good idea either. Because without echo what you type on the shell will be interpreted as a command, or other things.... which I won't get into because I'll just confuse you even more.

    So when you want to show text, you can use echo. If you want to send text to a file. You say echo "hello world" > my_file_name 

    Again, without using echo here, "hello world" will be interpreted as a command.  The > symbol is used to redirect the text of "hello world" to a file.

    You should also type 'man echo' without the quotes the next time you're in linux. The program 'man' will show you the manual of echo, the manuals can be a bit complicated to read, but you will get used to them. :)

    A good beginners guide: 

    http://www.linux.org/lessons/beginner/index.html 

    good luck and have fun  

     EDIT:

    Btw, you can type the command 'env' to show all of your environment variables. That is where $HOME and $USER is.

    You should get a Live linux cd such as knoppix, you don't need to install it to your HD. It will run from your DVD/CD drive. The best way to learn linux is to use it, use it often, and read the man pages to find out what stuff does. 

    If I could rate this post I'd give you 5 eggs Yes

     


    "Oh Gravity, Thou Art A Heartless b***h"

    -Sheldon

    Click to read my stories.
  •  02-10-2008, 8:17 PM 264313 in reply to 264260

    Re: linux command questions

    lol thanks. I've been postin alot today to get me outta the embryo tier and thus far nobody has given me any eggs :<
  •  02-10-2008, 9:44 PM 264363 in reply to 264313

    Re: linux command questions

    Heh. One day they will bring back the ranking system.

     


    "Oh Gravity, Thou Art A Heartless b***h"

    -Sheldon

    Click to read my stories.
  •  02-10-2008, 9:56 PM 264368 in reply to 264363

    Re: linux command questions

    Hey root, i can still see the eggs and rank the posts.  You just have to wait for them

    Or did they kill the system thus rendering my rating useless? 

  •  02-11-2008, 6:24 AM 264466 in reply to 264368

    Re: linux command questions

    kunzy:

    Or did they kill the system thus rendering my rating useless? 

    Yes

     


    "Oh Gravity, Thou Art A Heartless b***h"

    -Sheldon

    Click to read my stories.
View as RSS news feed in XML

 Home   Forums   Chat   Blogs   Deals   Newsletter   About 

 FAQ   Terms of Use   Privacy Policy   Contact Us 

©2009 Newegg, Inc. All rights reserved.