07-02-2008
How to run multiple command in single command?
Dear Unix Guru,
I have several directories as below
/home/user/
dir1
dir2
dir3
Each directory has different size. I want to print each directory size (Solaris command du -hs .)
Can you please guide me how to achieve this?
Thanks
Bala
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi everybody..
I need to enter in bash mode and then run a command and this just in a single command line.
I tried : "bash ^M| somecommand" but nothing..
How do I do to simulate the return button just right after the bash command ?
Thanks.. (8 Replies)
Discussion started by: Riddick61
8 Replies
2. Shell Programming and Scripting
Hi
I have following list of files at a path:
01.AR.asset
01.AR.index
01.AR.asset.vf
01.AR.asset.xv
I want to rename all these files as follows:
73.AR.asset.Z
73.AR.index.Z
73.AR.asset.vf.Z
73.AR.asset.xv.Z
Can any body give me a single command to acheive the above results.
... (5 Replies)
Discussion started by: tayyabq8
5 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I will use below command for grep single string ("osuser" is search string)
ex: find . -type f | xarg grep -il osuser
but i have one more string "v$session"
here i want to grep in which file these two strings are present.
any help is appreciated,
Thanks in advance.
Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies
4. Solaris
Hii All
I was building two M4000 servers and one was successfully installed.
Other one /usr has been unmounted. my putty session got disconnected and i connected to console where it asked for root single maintence
#
# init 0
not foung
# df -h
not found
#
xscf>poweroff -a
xscf>... (8 Replies)
Discussion started by: seems
8 Replies
5. Shell Programming and Scripting
I have a log directory:
/logs/foo.log
/logs/bar.log
/logs/err.out
I'm trying to find a way to
> /logs/*.log
> /logs/*.out
to blank them out, but of course, that doesn't work.
Any suggestions? (4 Replies)
Discussion started by: Validatorian
4 Replies
6. UNIX for Dummies Questions & Answers
Normally i would do this-
cd abc
ls -ltr
I wish to run above command in a single line, like this-
cd abc | ls -ltr
But above command doesn't works, it simply runs the second command, ignoring the 1st one.
:confused: (4 Replies)
Discussion started by: boy18nj
4 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I would like to sftp 2 files with a single command. I tried the below options,
sftp suer@test13:"/u01/home/oracle/SetDb.sh /u01/home/oracle/.profile" ./
But what actually happens is
Fetching /u01/home/oracle/SetDb.sh to /u01/home/oracle/.profile
/u01/home/oracle/SetDb.sh ... (3 Replies)
Discussion started by: sid2013
3 Replies
8. Shell Programming and Scripting
myenv.sh script sets LOG_DIR variable.
I can run the script and echo the variable in a single line as:
# First set LOG_DIR to some dummy 'NONE' value
$ export LOG_DIR="NONE"
$ echo ${LOG_DIR}
NONE
$ cat /tmp/bin/myenv.sh
export LOG_DIR="/tmp/log"
#The below command doesn't show the... (2 Replies)
Discussion started by: ysrini
2 Replies
9. Solaris
Hi,
I have Solaris-10 OS on T5220. Both local disks were mirrored under SVM. Somehow when one disk gone bad (c0t1d0), other disk (c0t0d0) also got lot of bad block. We have readable data only on c0t0d0, but as soon as server comes after, it hangs when I run few commands because of read errors,... (1 Reply)
Discussion started by: solaris_1977
1 Replies
10. Shell Programming and Scripting
Hi All,
How can i run a single command on multiple servers with or without giving credentials.
I have a file(servers.txt) which has got list of servers and i want to run a command lsb_release -dr on all these servers and get output of those servers against each server.
I tried below code... (9 Replies)
Discussion started by: darling
9 Replies
LEARN ABOUT MINIX
synctree
SYNCTREE(1) General Commands Manual SYNCTREE(1)
NAME
synctree - synchronize directory trees.
SYNOPSIS
synctree [-iuf] [[user1@]machine1:]dir1 [[user2@]machine2:]dir2
DESCRIPTION
Synctree synchronizes the directory tree rooted at dir2 with dir1. It walks recursively through both trees, and deletes and adds files in
dir2 to make it equal to dir1. Mode, owner and group are set for each file unless the -u flag is given. In its normal mode of operation,
synctree will ask if it may delete or add directories assuming that you don't want to. Non-directories are simply deleted or added, but
synctree will ask if it needs to update a normal file with a default answer of 'y'. Simply typing return will choose the default answer,
typing end-of-file is like typing return to this question and all other questions.
You can specify a hostname and user-id to be used to access dir1 or dir2. Synctree will use rsh(1) to run a copy of itself on the remote
machine. The call interface mimics that of rcp(1), but you can use more than one user@machine prefix if you want to make things really
interesting.
Hard links are enforced, an update is done by first deleting the old file so that links to unknown files are broken. Links to files within
dir2 will be restored.
If either directory contains the file .backup, then this file will be used as an alternate inode table. This allows one to make a backup
copy of a file tree full of special files and differing user-ids on a remote machine under an unpriviledged user-id.
OPTIONS
-i Ask for permission (with default answer 'n') to delete or add any file or directory.
-u Only install newer files, i.e. merge the directory trees.
-f Don't ask, think 'yes' on any question.
SEE ALSO
remsync(1), cpdir(1), rsh(1), rcp(1), perror(3).
DIAGNOSTICS
Messages may come from three different processes. One named "Slave" running in dir1, one named "Master" running in dir2, and synctree
itself in a mediator role. The mediator will also perform the task of either the master or the slave if one of them is running locally.
You need to know this to interpret the error messages coming from one of these processes. The messages are normally based on perror(3).
Failure to contact a remote machine will be reported by rsh. Synctree should have a zero exit status if no errors have been encountered.
BUGS
Directory dir2 will be created without asking.
The master and slave processes get their error output mixed up sometimes (nice puzzle).
The local and remote machine must use the same file type encoding.
The link replacement strategy may lead to lack of space on a small device. Let synctree run to completion and then rerun it to pick up the
pieces.
Letting the local process keep its "synctree" name may be a mistake.
It talks too much.
AUTHOR
Kees J. Bot, (kjb@cs.vu.nl)
SYNCTREE(1)