Send output of command to screen and to multiple files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Send output of command to screen and to multiple files
# 1  
Old 12-17-2013
Send output of command to screen and to multiple files

Hi there,

I'm a newbie to Unix (taking a course in it right now) and I don't know how to do the following in bash:

I need to write a command to display information about the used and free space on the file system, showing only local file systems, and then send the output of the command to the screen and to three files named status1, status2, and status3. Do this all in one command line.

so far I have

free -mt > status1>status2 > status3

and that put what I wanted in the 3 files...but it doesn't output that info to the screen.....

Thanks in advance for any help you have
# 2  
Old 12-17-2013
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send output of time command to file

I am measuring the time it takes for a wget command to complete. Right now my command is: time wget https://`ifconfig -a | grep '32.29.120' | cut -d: -f2 | cut -d' ' -f1`:8443/primary-rest/shop?brandId=test --header="name: test" --no-check-certificate -o SELF_TEST.log The output I get is ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

2. Shell Programming and Scripting

Send multiple HTML output in one mail

HI, I have two scripts which is sending the mail in html format. Script 1: 1.IFILE=/home/home01/Report.csv if #Checks if file exists and readable then if awk -F, '{ T += $13 } END { exit(!T) }' ${IFILE} then awk -F, 'BEGIN{ c=split("3,4,8,9,13", col) print "To:... (0 Replies)
Discussion started by: Vivekit82
0 Replies

3. Shell Programming and Scripting

Send output of a command as an email

Hello Unix Experts! We are on AIX 6.1 TL6 I am trying to develop a script that does the following: It should send the output of "df -g /directory/folder" command as an email to a user(someone@company.com) This is too simple and i can research on how to do it, but it would be great if... (2 Replies)
Discussion started by: atechcorp
2 Replies

4. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

5. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

6. Shell Programming and Scripting

command output to variable assignment and screen simultaneously

Hello Folks, I have a script that runs a command (rsync) that sometimes takes a long time to complete and produces diagnostic output on stdout as it runs. I am currently capturing this output in a variable and using it further in the script. I would like to continue to capture this output... (2 Replies)
Discussion started by: mbm
2 Replies

7. UNIX for Dummies Questions & Answers

help in redirecting output to multiple logfiles without displaying it on the screen

Hi, 1.some_command > logfile1 2>&1 will redirect everything to the file logfile1 without displaying the output of the command on the screen. 2.some_command | tee logfile1 | tee logfile2will redirect the output to logfile1 and logfile2, as well as display the output of the command on the... (1 Reply)
Discussion started by: akhila
1 Replies

8. UNIX for Dummies Questions & Answers

Seeing the screen output beyond the scroll capability for the last run command

HI , I forgot to redirect my op to a file.The op which is quite huge , thus printed on the screen.However bcoz of the limited viewing in the screenI can not see the whole of the output.. Is there anyway I can see the full op.My run takes half a day for finnishing ..So I am refraining... (1 Reply)
Discussion started by: bimukt
1 Replies

9. Shell Programming and Scripting

awk to compare lines of two files and print output on screen

hey guys, I have two files both with two columns, I have already created an awk code to ignore certain lines (e.g lines that start with 963) as they wou ld begin with a certain string, however, the rest I have added together and calculated the average. At the moment the code also displays... (3 Replies)
Discussion started by: chlfc
3 Replies

10. UNIX for Advanced & Expert Users

GNU Screen: Send to Multiple Screens at Once?

There is a feature that I used in KDE's Konsole that I really miss when I'm on a non-GUI server. The ability to "broadcast" what I type to all open windows. That led me to wonder if this could be done with GNU screen (since it can do a whole lot of other cool stuff)? Basically, it would be... (3 Replies)
Discussion started by: deckard
3 Replies
Login or Register to Ask a Question