Copy a command string from the command line

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copy a command string from the command line
# 1  
Old 09-22-2009
Copy a command string from the command line

How can we copy a command string from a previous command line and paste it into the cursor position on the current command line? I know that ^c will not work as the shell will interpret as an interrupt signal.

# 2  
Old 09-23-2009
This is specific to your terminal emulator. If you are using the Gnome Terminal Emulator, you can use SHIFT+CTRL+C to copy and SHIFT+CTRL+V to paste.

EDIT: As noted above, if you are simply trying to repeat a command, hitting the up arrow key is the best method of doing this.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash Command to Get Nth Line in a String?

hi i need to get the 3rd line in a string. actually, not sure if it's a string, list, array, or something else. I'm using grep to retrieve all the numbers in a string-- in the console, it displays as multiple lines: $ echo "Sink 0: reference = 0: 153% 1: 45%, real = 0: 62%" | grep -o * 0... (4 Replies)
Discussion started by: johnywhy
4 Replies

2. Shell Programming and Scripting

delete the line with a particular string in a file using sed command.

Hello, I want to delete all lines with given string in file1 and the string val is dynamic. Can this be done using sed command. Sample: vars="test twinning yellow" for i in $vars do grep $i file1 if then echo "Do Nothing" else sed `/$i/d` file1 fi done Using the above... (5 Replies)
Discussion started by: PrasadAruna
5 Replies

3. Shell Programming and Scripting

Can a string be a command line argument?

I would like to use a string as a command line this possible using TCSH? For example say my script is called TEST and I would like to pass a string into my script stating why the test failed. EXAMPLE: TEST "Failed due to missing statement" (4 Replies)
Discussion started by: thibodc
4 Replies

4. Shell Programming and Scripting

Removing command line arguments from string list

I am passing a list of strings $list and want to remove all entries with --shift=number, --sort=number/number/..., --group=number/number/... Also are removed whether upper or lower case letters are used For example the following will all be deleted from the list --shift=12 --shift=2324... (7 Replies)
Discussion started by: kristinu
7 Replies

5. Shell Programming and Scripting

Command output string manipulation possible in one line?

This has been bothering me for 3 days. $> hostname cepsun64amd And I just want "cepsun", I would normally do h=`hostname`; ${h%%64*} But I am looking for a one-liner just for my own knowledge, because if there is a way to do this, I should know it by now. Anyway, so is this... (2 Replies)
Discussion started by: Ryan.
2 Replies

6. Shell Programming and Scripting

On the command line using bash, how do you split a string by column?

Input: MD5(secret.txt)= fe66cbf9d929934b09cc7e8be890522e MD5(secret2.txt)= asd123qwlkjgre5ug8je7hlt488dkr0p I want the results to look like these, respectively: MD5(secret.txt)= fe66cbf9 d929934b 09cc7e8b e890522e MD5(secret2.txt)= asd123qw lkjgre5u g8je7hlt 488dkr0p Basically, keeping... (11 Replies)
Discussion started by: teiji
11 Replies

7. Shell Programming and Scripting

Remove Command-Line Option from String

I want to add a "-r <remote_host>" option to my ksh script, causing the script to run a script of the same name on the specified remote host. The remote invocation should itself include all the command-line options of the original invocation, less the -r option. For example, this invocation: ... (7 Replies)
Discussion started by: mattmiller
7 Replies

8. UNIX for Advanced & Expert Users

Command to display nth line before the string is matched.

All, Is there any way out to display the nth line before the string is matched ??? Eg : If i have a file which has the following contents and if i want to get the 3rd line before the string is matched a b c d e f if i give the input as f and lines before the match as 3 then it should... (5 Replies)
Discussion started by: helper
5 Replies

9. Shell Programming and Scripting

how to? launch command with string of command line options

my description from another thread... here's my code: #!/bin/bash IFS=$'\n' function OutputName() { input=$1 echo $input input=`echo "$input" | sed -e 's/.//'` input=`echo "$input".avi` output_name=$input } if ]; then echo... (5 Replies)
Discussion started by: TinCanFury
5 Replies
Login or Register to Ask a Question