Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've been given a basic Linux assignment in my Computer Concepts class, and I *think* I managed to enter all the commands and get the results expected. But I also have to define terms relating to Linux, and I've found everything except >>. I actually used it in my exercise: Type echo “enter_your_name_here” >> test2, but I'm not sure exactly what it did. Can anyone help?
I really appreciate your help! I was surprised to find I actually enjoyed playing around with Linux. It was fun to use the commands and see things happen.
Head on a Stick told me that > would replace the content with the output. In this Linux exercise, our first step is to create a file named test1, using the touch command. The following step is to type echo "This is a test" > test1. Typing cat test1 shows This is a test. So am I understanding this correctly when I think test1 has been replaced with This is a test? When I try to duplicate the effect, I'm not successful.
'touch test1' creates a empty file named test1 if only no such file exists.
So better do 'echo abc > test1'
Then check with 'cat test1'
Then again put some text with 'echo def > test1'
Then check with 'cat test1'
So you would see abc replaced with def.
Basically, when talking about files, take care to be explicit about whether you are talking about the file as a whole, the filename, or the file content...
'cat' is short for catalogue (way back when) - basically types out the content of the file to stdout
touch is used to create a file (also to alter timestamps)
echo 'string' > file puts 'string' into file REPLACING current content ( '>>' appends to current content)
NB: this means that '>file' empties the file
I got a perfect score on my Linux lab, and actually learned a lot! The professor suggested working with DOS as well as Apple (ugh) to see similarities and differences. Apparently learning directory hierarchies was one of the goals here.
This is definitely fun for me to play with, but when do you actually use Linux in this way?
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by flyingmouse77
This is definitely fun for me to play with, but when do you actually use Linux in this way?
One could, I suppose, install and use modern Linux day in day out and only in rare cases have to touch the command line (much as with Windows) but for me, and others I suspect, typing a few commands to update the system and install packages seems more straightforward than messing with a GUI and in the case of my Pi, for example, I don't have a monitor or input devices attached so it is much easier to use SSH to get into it and work on the command line.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.