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.
If I have a user and I want to add it to /home and pass the output with the errors to a text file to the /tmp directory would this be the right command?
User1 -a &> /home/tmp/text
If I have a user and I want to add it to /home and pass the output with the errors to a text file to the /tmp directory would this be the right command?
User1 -a &> /home/tmp/text
Not that I can see. I really can't tell what exact information you wish to gather, and what you want result to be.
How about: "When you run that command you wrote, what happened?"
user1 is the user
aslo what is the command I put in the beginning?
What information do you want? You've never said this. Your original question was:
Quote:
Originally Posted by ash997
If I have a user and I want to add it to /home and pass the output with the errors to a text file to the /tmp directory would this be the right command?
User1 -a &> /home/tmp/text
Are you asking how to add a user to your system, or are you asking about doing something with an existing user? You've been told that your question is unclear.
Please provide the correct unix command(s) to user1 to their traditional place (/home) with a bash shell and pass the output - including errors - of the command into a text file on it into the /tmp directory.
user1 is the user
aslo what is the command I put in the beginning?
would it look like this Mkdir /home/user1 >/tmp/text 2>&1
You've edited your post and now it shows a mkdir command. Have you tried that? What resulted other than nothing into the /tmp/text file? Because the successful return from a mkdir command is a return code to your bash return variable, but otherwise no text output details. It seems as if you want a log of the result of a mkdir command. Unless there was an error, there is no text based return from that system call.
Perhaps besides putting out a series of varied command attempts without indicating any outcome you've experienced, you should instead write clearly what you intend to do. Sorry, not trying to be difficult, but your question is as confusing now as it was in the first post.
EDIT: See my next, because I see that you finally wrote a brief paragraph describing what you're trying to do. I still have a question about it.
Please provide the correct unix command(s) to user1 to their traditional place (/home) with a bash shell and pass the output - including errors - of the command into a text file on it into the /tmp directory.
Are you saying you want to log every command made by a user?
No I forgot to say add. Please provide the correct unix command(s) to add user1 to their traditional place (/home) with a bash shell and pass the output - including errors - of the command into a text file on it into the /tmp directory. That's what the question should look like..
No I forgot to say add. Please provide the correct unix command(s) to add user1 to their traditional place (/home) with a bash shell and pass the output - including errors - of the command into a text file on it into the /tmp directory. That's what the question should look like..
Please look up the useradd(8) command and refer to berndbausch's reply in post #3 regarding how to log the outcome of your command.
Your fellow members are all volunteers. Same as you.
Your recent question asked how to add a user, and you were directed to look up the useradd command, as well as given a link to the manual page.
Two different users have given valid ways to re-direct stdout and stderr to a file, where both ways will work.
It seems clear that you have not tried any command at all and you seem to be repeatedly asking your fellow members to "give" you a command.
You've been a member of LinuxQuestions long enough to know that this is not how the site works.
Please take the time to review links on the LQ site, here to aid you with how best to formulate your technical questions.
Please understand that it is very difficult for anyone to help you when you ask incomplete, unclear questions and also do not follow up on advice already given.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.