Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to run multiple command in a single line? Post 302623731 by boy18nj on Saturday 14th of April 2012 12:33:26 PM
Old 04-14-2012
How to run multiple command in a single line?

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.

Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

run command Unix on a single line

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. UNIX for Dummies Questions & Answers

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 (2 Replies)
Discussion started by: baluchen
2 Replies

3. Shell Programming and Scripting

single line input to multiple line output with sed

hey gents, I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
Discussion started by: mitch
8 Replies

4. Shell Programming and Scripting

How to run the multiple scp from single script?

Dear Experts, how to run multiple scp commands from single scripts. In a directory oracle redo files accumulate. i would like to copy those redo logs to my standby server. For same i am using scp to copy the files. where i am monitoring that as it is sending the files sequentially most of... (1 Reply)
Discussion started by: nmadhuhb
1 Replies

5. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

6. Shell Programming and Scripting

running multiple command in a single line

Hi Can we run the linux command and per script in a single command $ cd /usr/local/adm/ ;ctsv scmtest_qabuild ;cspec.pl scmtest This is a combination of linux and clearcase command and last one is perl script with argument. I can see the first and 2nd coomand is executing but last... (6 Replies)
Discussion started by: anuragpgtgerman
6 Replies

7. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

8. Shell Programming and Scripting

Su and run single line command

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. UNIX for Beginners Questions & Answers

A single script to run multiple scripts

Hi , Can someone help! I need a shell script to run multiple scripts by using single shell script, incase any one of the scripts fails, it should get exit and after trouble shooting if we re-execute it, it should start from the failed script. I have a written a scripting till the... (1 Reply)
Discussion started by: anniesurolyn
1 Replies

10. Shell Programming and Scripting

How to run simple single command on multiple Linux servers?

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
show link(1m)															     show link(1m)

NAME
show link - Displays attribute information about the specified soft link SYNOPSIS
cdscp show link link-name [attribute-name] [with attribute-name = attribute-value] ARGUMENTS
The full name of a specific soft link. The last simple name can contain wildcard characters. The name of a particular attribute; see Description for valid attribute names. The value of a particular attribute. DESCRIPTION
The show link command displays the names and values of the attributes specified in attribute-name. You can use a combination of attributes in any sequence in a single command. Use a space to separate multiple attributes. You can use a with attribute-name = attribute-value clause to limit output only to soft links whose attributes have values equal to the specified values. A space must precede and follow the = (equals sign). If you do not supply any attributes, the command displays all attributes and their values. The following is a description of soft link attributes: Specifies the creation timestamp (CTS) of this soft link Specifies the full name of the directory, object entry, or other soft link to which the soft link points Specifies a timeout value after which the soft link is either checked or deleted Specifies the timestamp of the most recent update to an attribute of the soft link Privilege Required You must have read permission to the soft link. If you specify a wildcard soft link name, you also need read permission to the directory that stores the soft link. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLE
The following command displays the current values of all the attributes associated with the soft link /.:/sales/region1. cdscp> show link /.:/sales/region1 SHOW SOFTLINK /.../abc.com/sales/region1 AT 1991-10-15-15:54:40 CDS_CTS = 1991-10-15-19:54:35.00000003/08-00-2b-1c-8f-1f CDS_UTS = 1991-10-15-19:54:35.00000006/08-00-2b-1c-8f-1f CDS_LinkTarget = /.../abc.com/sales/service SHOW SOFTLINK /.../abc.com/sales/region1 AT 1991-10-15-15:54:41 CDS_CTS = 1991-10-15-19:54:36.00000077/08-00-2b-1c-8f-1f CDS_UTS = 1991-10-15-19:54:36.00000009/08-00-2b-1c-8f-1f CDS_LinkTarget = /.../abc.com/sales/software CDS_LinkTimeout = : Expiration = 1991-10-15-00:00:00.0 Extension = +1-00:00:00.000 RELATED INFORMATION
Commands: create link(1m), delete link(1m), list link(1m), remove link(1m), set link(1m) show link(1m)
All times are GMT -4. The time now is 03:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy