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
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
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
2. Shell Programming and Scripting
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
3. UNIX for Dummies Questions & Answers
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
4. UNIX for Dummies Questions & Answers
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
5. Shell Programming and Scripting
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
6. UNIX for Dummies Questions & Answers
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
df_hfs(1M) df_hfs(1M)
NAME
df_hfs: df - report number of free CDFS, HFS, or NFS file system disk blocks
SYNOPSIS
FStype] specific_options] [special|directory]...
DESCRIPTION
The command displays the number of free 512-byte blocks and free inodes available for file systems by examining the counts kept in the
superblock or superblocks. If a special or a directory is not specified, the free space on all mounted file systems is displayed. If the
arguments to are path names, reports on the file systems containing the named files. If the argument to is a special of an unmounted file
system, the free space in the unmounted file system is displayed.
Options
recognizes the following options:
Report only the number of kilobytes (KB) free.
Report the total number of blocks allocated for swapping to the file system
as well as the number of blocks free for swapping to the file system. This option is supported on HFS file systems
only.
Report the number of files free.
Report only the actual count of the blocks in the free list
(free inodes are not reported). When this option is specified, reports on raw devices.
Report only on the
FStype file system type (see fstyp(1M)). For the purposes of this manual entry, FStype can be one of and for the
CDFS, HFS, and NFS file systems, respectively.
Report the entire structure described in
statvfs(2).
Report the total number of inodes,
the number of free inodes, number of used inodes, and the percentage of inodes in use.
Report the allocation in kilobytes (KB).
Report on local file systems only.
Report the file system name.
If used with no other options, display a list of mounted file system types.
Specify options specific to the HFS file system type.
specific_options is a comma-separated list of suboptions.
The available suboption is:
Report the number of used and free inodes.
Report the total allocated block figures and the number of free blocks.
Report the percentage of blocks used,
the number of blocks used, and the number of blocks free. This option cannot be used with other options.
Echo the completed command line, but perform no other action.
The command line is generated by incorporating the user-specified options and other information derived from This
option allows the user to verify the command line.
When is used on an HFS file system, the file space reported is the space available to the ordinary user, and does not include the reserved
file space specified by
Unreported reserved blocks are available only to users who have appropriate privileges. See tunefs(1M) for information about
When is used on NFS file systems, the number of inodes is displayed as -1 . This is due to superuser access restrictions over NFS.
EXAMPLES
Report the number of free disk blocks for all mounted file systems:
Report the number of free disk blocks for all mounted HFS file systems:
Report the number of free files for all mounted NFS file systems:
Report the total allocated block figures and the number of free blocks, for all mounted file systems:
Report the total allocated block figures and the number of free blocks, for the file system mounted as /usr:
WARNINGS
does not account for:
o Disk space reserved for swap space,
o Space used for the HFS boot block (8K bytes, 1 per file system),
o HFS superblocks (8K bytes each, 1 per disk cylinder),
o HFS cylinder group blocks (1K-8K bytes each, 1 per cylinder group),
o Inodes (currently 128 bytes reserved for each inode).
Non-HFS file systems may have other items that this command does not account for.
The option, from prior releases, has been replaced by the option.
FILES
File system devices.
Static information about the file systems
Mounted file system table
SEE ALSO
du(1), df(1M), fsck(1M), fstab(4), fstyp(1M), statvfs(2), mnttab(4).
STANDARDS CONFORMANCE
df_hfs(1M)