Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-28-2012, 09:42 PM   #1
LQ Newbie
Registered: Sep 2012
Posts: 2

Rep: Reputation: Disabled
how to create a file with data

hi im new to linux. and this is a very basic question that im stuck with. i got a question on an assignment recently that asks for a single line command to create a file called current and that contains a list of current users. i only kno the touch and cat > commands to create a file.
Old 09-28-2012, 09:57 PM   #2
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
Since it's a homework question, I'll give you some pointers instead of a direct answer.

A simple search on your favorite search engine with the terms How to get a list of logged on users on Linux will give to command to retrieve a list of currently logged on users.

You can then use redirection to save the list to a file. Redirection allows you re-direct the output of a command to one or more file descriptors, which in your case would be a text file.

Here are some links:
Old 09-28-2012, 11:21 PM   #3
LQ Newbie
Registered: Sep 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
oh ok. i got it now. thanks a lot for the info


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
I didn't create data file the 1st time - can I do it now? Slacko Puppy ejoanie Linux - Newbie 0 06-18-2012 07:01 PM
[SOLVED] extract directory and xml data to create a comma delimited file j-me Programming 33 05-10-2012 08:57 AM
How to Create sparse file with alternate data and hole. mango7 Programming 4 10-13-2011 08:02 AM
Create File Shell Syntax and pass data to the file FirstBorn Linux - General 22 07-31-2008 09:48 PM
use script to create a data file of mulitple users RajRed Linux - Newbie 4 11-27-2007 06:05 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:00 PM.

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