LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-08-2013, 05:04 AM   #1
somilsharma8
LQ Newbie
 
Registered: Sep 2013
Posts: 3

Rep: Reputation: Disabled
unable to save my progress on the terminal


hey guys, i'm a beginner at linux and i'm learning about it from a book called "Running Linux"(O.Reilly Publications). It was going real smooth but now i'm stuck at the part where i save my output :/ the command, "ls /home/user >> `/Name" is not running as expected.... what am i doing wrong?
 
Old 09-08-2013, 07:03 AM   #2
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Well, from a quick glance, you're trying to redirect the output of the ls command to a file called "Name" in your root directory. Only root (should) be able to modify files and directories there. You should have received an error message; when I try I get:

Code:
anthony@serenity:~$ ls /home/anthony >> /Name
bash: /Name: Permission denied
It's not a good idea to save files in /. Nothing's likely to happen, but then it looks like a mess like on other operating systems (ahem, Windows, why do you insist on saving Update Installtion, and other logs in C:\???).

Your other problem is if you are not replacing "/home/user" with your own directory, if in fact you typed into the terminal exactly what you described.

You must remember when following examples from books, the web, &c.; that certain words (usually boldface in books, or some other distinct type) are to be replaced with your own username, filename, etc.
 
1 members found this post helpful.
Old 09-08-2013, 07:21 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by somilsharma8 View Post
"ls /home/user >> `/Name" is not running as expected.... what am i doing wrong?
Perhaps you meant
Code:
ls /home/user >> ~/Name
but bash ~/Name would NOT run ls -al /home/user but just give you the ls output.

If you wish to run /home/user/Name and have it run like ls -al /home/user then use
Code:
echo "ls -al /home/user" >> ~/Name
bash ~/Name
 
2 members found this post helpful.
Old 09-08-2013, 07:55 AM   #4
somilsharma8
LQ Newbie
 
Registered: Sep 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
thanks Habitual, your suggestion really helped...... the thing is that i've been following the content in the book religiously and its been correct so far..... anyway, thanks a ton you guys
 
Old 09-08-2013, 08:07 AM   #5
somilsharma8
LQ Newbie
 
Registered: Sep 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
One more thing, I don't think I understand the functioning of
Quote:
echo "ls -al /home/user" >> ~/Name
bash ~/Name
can you break it down for me?
 
Old 09-08-2013, 08:16 AM   #6
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by Habitual View Post
Perhaps you meant
Code:
ls /home/user >> ~/Name
but bash ~/Name would NOT run ls -al /home/user but just give you the ls output.[/CODE]
Man, that backtick in the OP was so small on my screen, I didn't even see that typo. Oops!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
save terminal to database jrahma Linux - Newbie 15 11-06-2011 11:36 AM
how to copy a directory (local) from terminal with progress bar showing Linux.Girl Linux - Newbie 6 08-19-2010 10:00 AM
copy at terminal with progress bar. DoME69 Programming 6 03-10-2009 01:41 PM
Very good install... I want to save my progress this far.. hesees Debian 2 09-22-2008 01:07 AM
Terminal size (How to save??) sevvy8 Linux - Software 2 08-16-2004 06:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration