2

Is there any tool/terminal emulator which supports that I can insert my 'favourites' like '2>/dev/null' or 'date +%Y%m%d%H%M' and so forth .. everywhere into the command line ?

I could not find any terminal emulator, or clipboard tool which has favorites ... :(

Thanks in advance.

Using aliases and bash functions are not enough flexible inserting these anywhere into the command line.

1

Save them as variables in your .bashrc (or if you use another shell, save them in its rc file).

For example: You can insert the line var1='2>/dev/null' in your .bashrc file. Once you start the terminal and run any script which runs via bash (its shebang should refer to bash), you can refer to your variable by using $var1

| improve this answer | |
  • It would be good if they can be copy pasted into the command line, but it is one step further, many thanks. – user2013619 Nov 3 '13 at 11:38
0

If you have a preferred invocation of date, you can set an alias:

alias date='date +%Y%m%d%H%M'

Now whenever you type date, you'll get the output of date +%Y%m%d%H%M. You don't have to use the same name, e.g., you could use alias date2=....

You can make that permanent by adding it to ~/.bashrc.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.