Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I use
./a.out <in >out
to take input from in file and writing output to out file while running a C++ program in Linux, but if I want to only write to out file then how will I do it using this?
Well, the input has to come from somewhere so, if you leave off input redirection, it will come from the current standard input, most likely your terminal:
./a.out >out
If you want no input (or, more precisely, immediate end-of-file), you can read from the null device:
./a.out </dev/null >out
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am confused with how shuf command works with streaming input. Does it buffer the data? Or is there some way of doing this in an online fashion.
This tool reads either a file, or from the linux/unix stdin. There is no streaming.
When you do just do shuf on the command line, you will have to press CTRL-D at some point to tell it "input is complete". Only then the tool starts processing the data.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have just started learning the Linux system and I need some help to translate the following to English:
grep WARNING readme.txt
and
grep WARNING readme.txt > warnings.txt
This is a homework question that i have researched myself but having trouble learning exactly what it means.
thanks in advance.
Try making a file on your computer named readme.txt. Put some lines of text in there, and make sure that some lines say "WARNING" while other lines do not.
Then run your first command and observe its output.
Then run your second command and observe its output and observe what was written to warnings.txt.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have used a command called 'cat /etc/group' what does this command mean and do.Can you tell me what each part of the command does please use simple terms.
You can find the answer to your question explained better than any of us ever could with this command:
man cat
It prints to standard output the contents of the file at the location /etc/group
Ok so cat outputs the file, which (in your case) contains basic info about groups.
If you are interested in what are the groups just click here
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
How can I block someone from spamming by console using the "write" command in unix.
Run the command mesg n. Preferably, add it to your .bashrc or equivalent so it runs when you start up.
In your console, type:
mesg n
For more information, read the manual pages (man mesg).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
So I used "shuf" to make a word-list, The problem is when I run the command shuf -i 0500000000-0599999999 -o passwords.lst it doesn't type the first number which is '0' so I want a command to type that '0' into the beginning of every-line, if it's not possible with shuf any command will help.
This piped command will simply prepend a zero:
shuf -i 0500000000-0599999999|sed s/^/0/ > passwords.lst