Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [alias]

An alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding typing a long command sequence. This can save a great deal of typing at the command-line and avoid having to remember complex combinations of commands and options.

0
votes
2answers
116 views

To create an alias for grep and to exclude svn directory

To create an alias for grep and to exclude svn directory (currently no questions cover this) on bash env I did: $ function gp {grep -rnIi --exclude-dir='.svn';} However, I get error bash: syntax ...
0
votes
2answers
27 views

Entering the last modified directory

Which command can I use to: Enter the last modified directory in the current directory. If no directory exists or is possible to enter, do nothing. I'm looking for an alias named ca that will work ...
0
votes
2answers
149 views

why does /var/mail/{username} = /Users/{username}?

My basic question is why do both of these paths point to home (i.e., ~)? Is it pointing to the same home or is it duplicated? I doubt it's duplicated, so if not, how does cd .. decide which directory ...
5
votes
1answer
847 views

How to enable `sudo` with custom functions?

Recently I learned you can enable sudo for custom aliases as follows: alias sudo='sudo ' # note: the space is required! The reason this works is the following: If the last character of the alias ...
4
votes
1answer
321 views

Does tcsh have an equivalent for “${a:-b}” for default variable assignment like Bash?

I want to do this in one line because I want to use it in my aliases. Can I do this similarly in tcsh ? Using “${a:-b}” for variable assignment in scripts There are some ways of doing it here but ...
4
votes
1answer
1k views

Run command with sudo by default

I need a linux user (lets call him "bob") who is allowed to run a list of commands which require root privileges. So let him be required to run /sbin/firstcommand and /sbin/secondcommand (which are ...
3
votes
1answer
51 views

can you alias to a position inside a file?

Is there a way to create an alias that will open a pdf or other document to a particular position? For example, I have a 105 page pdf which I want to alias/shortcut to in a directory on my system. But ...
3
votes
1answer
664 views

parametric aliases in csh to add export command

I'm trying to find a way to translate functions to csh/tcsh aliases, since they lack functions but have parametric aliases. As a first step I'm trying to create an export command. Here's what I've ...
2
votes
1answer
664 views

Can I use an environment variable to define an alias?

I'm using an automation engine to run perl scripts. script_X requires a wrapper script so it's run like: wrapper_script script_X --parameters But the automation engine can't understand that ...
2
votes
1answer
159 views

Can I set defaults for rsync in non daemon mode?

Can I set defaults for rsync in non daemon mode? I know the daemon mode has this configuration file: /etc/rsyncd.conf But I typically use the non daemon version in this sort of manner: rsync -avzcO -...
1
vote
1answer
1k views

Use aliases as custom commands in terminator

I am using a terminator layout to start multiple terminals, and would like to call an alias at each terminal start which is defined in my .bash_aliases (called by both .bashrc and .profile). ...
1
vote
1answer
77 views

Whitelist virtual_alias_maps

I have one mailbox in postfix and several aliases to it. Is it possible to create whitelists for specific alias in order to allow only the addresses from the list to send messages. For example: ...
0
votes
1answer
57 views

How can I run multiple unix commands sequentially using a single shortcut command?

I usually go through files using the following commands: cd first pwd ls cd second ls This a more generic way of my work. Can I execute all the commands one by one by itself by calling "some secret ...
0
votes
1answer
167 views

Always exclude path in find command

I have a directory whose contents should never be found by find, so I aliased find like this: alias find='find -not -path "*.sync*"' the issue is that find now complains that operators are not ...
0
votes
1answer
146 views

cd && ls function doesn't work in other aliases before reloading .bashrc?

I have the following code in my .bashrc: c() { cd "$@" && ls -a ; } alias cdd="c ~/Downloads" alias r=". ~/.bashrc" When I load a new terminal, cdd doesn't work before I do the r command. ...
0
votes
1answer
70 views

safe way to add aliases for another user?

At work I have a personal account, but I'm doing development on a program which is run by a machine account. By "machine account" I just mean that it isn't tied to a person - it doesn't have any ...
0
votes
1answer
93 views

Wrong subversion binaries in /bin /usr/bin

I am woking on a Mac and recently updated Xcode, within in this update it installs the latest version of subversion 1.9.x as the core installation. This would be fine but at work we use 1.8.x and this ...
0
votes
1answer
1k views

How to execute an alias, encapsulated in another source file?

For instance ~/.cshrc: alias job_start 'cd $PROJ_DIR && source .env/bin/activate.csh && rehash && job_run' $PROJ_DIR/.env/bin/activate.csh: alias job_run '(cd $PROJ_DIR/...
0
votes
1answer
545 views

How to launch Notepad++ from the Cygwin command line via an alias?

This is what I tried. $ alias n++='(cd `dirname $1`; "/cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe" `basename $1`)' alias n++='(cd `dirname $1`; "/cygdrive/c/Program Files (x86)/Notepad++/...
0
votes
1answer
436 views

grep alias to safely ignore multiple directories

The day to day usage is: grep -rIn pattern directory There are some files that I want to avoid, they are in directories that have this kind of path in them at some point: app/lib/bower/lodash, app/...
0
votes
1answer
451 views

make custom commands on android 4.4.2

I want to program and debug in my android phone. To do that I downloaded c4droid and it's gcc plugin. after a lot of tries I understood that gcc is in directory /data/data/com.n0n3m4.droidc/files/gcc/...
0
votes
1answer
202 views

KSH script missinterpreting alias stored in SQL oracle DB

I have stored the path of my file in a table with as an alias (as the complete path was too long for the table's field). However, in my KSH script, when I am doing : nomtmp=`sqlplus -S bla/bla <&...
2
votes
0answers
817 views

Multiples aliases for one command

I need to have multiple aliases for one command. I've done it like that: alias lwbc='$(npm bin)/webpack' alias lwpc=lwbc Is this a correct way?
1
vote
0answers
29 views

Share aliased folder on Windows host with Linux Guest using VirtualBox

I have a network drive on my Windows host that I have aliased as directory NetDir. NetDir is nested under ProjDir. I am sharing ProjDir from my Windows host to my Linux guest using VirtualBox. Non-...
1
vote
0answers
38 views

Is it possible to create aliases that affect services starting?

Currently I have a custom service that executes java in multiple places. I want to be able to add an option to any executions of java this service will spawn (I'm specifying the error log location, ...
1
vote
0answers
430 views

Is it possible to create an alias to rlogin and pass login paramteres?

There is a system I need to rlogin to for work, and each time it asks for my username and password and after the login I have to type in a code-word in order to get to the view I want. Is it possible ...
1
vote
0answers
179 views

alias Not able to execute source command

I am trying to define a following alias in my .aliases file. alias sett 'cleartool setview viewXYZ_!*; cd /path_dir1/dir2/; source ./env/script-name' I use it as sett myview on commnd prompt when I ...
1
vote
0answers
911 views

postfix expand ldap group AND afterwards resolve alias

We have a postfix server which has the user config stored in a openldap directory. Recently we also implemented ldap groups which are expanded by postfix. This works fine, unless the group expands to ...
1
vote
0answers
261 views

Why is Apache not respecting aliased directories?

In ssl_default.conf where Apache serves as an SSL-adding proxy for Django Gunicorn, I have: ... Alias /admin/static/ "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/" ...
0
votes
0answers
17 views

Using Alias for allowing a user to delete in a specfic directory and not prompting for a password

Need to allow a single user to delete folders / files within one directory, I have tried a few ways with and without alias but both ways it either prompts for a password or allows the user to remove ...
0
votes
0answers
19 views

Ending slogin session with exit command freezes due to PROMPT_COMMAND modification

I recently embedded an "alert" command into my PROMPT_COMMAND to give me a little notify-send screen notification with the exit code of each command (because I always forget to append the alert when a ...
0
votes
0answers
29 views

Creating alias with single parameter used in multiple places

I am trying to create a simple alias for SSH-ing to a host, like the below: alias wpessh='ssh $1@$1.ssh.wpengine.net' I also tried using a function as suggested by other answers here: function ...
0
votes
0answers
37 views

What is the correct way to assign a function containing chained commands to an alias in .bashrc?

I wish to invoke an alias as follows: alias_name arg0 arg1 arg2 arg0 = filename arg1 = General string arg2 = String representation of last command The aim is that by calling the alias and passing ...
0
votes
0answers
74 views

Attempting to setup alias for ts-node

Trying to setup an alias for ts-node on ubuntu 17.10 by adding alias ts='ts-node' to ~/.bashrc and then running source ~/.bashrc. After doing the above and running ts file.ts I get: The program '...
0
votes
0answers
258 views

Postfix ignores more than 1 alias from /etc/aliases

I want to forward all mails to root, to root: /var/spool/mail/root,first@example.com,second@example.com but postfix sends mails only to first@example.com... What should I do?
0
votes
0answers
881 views

Why alias could not be found in the shell

I was trying to set the alias for command: {cutadapt -O 24 -q 19,19 -m 30 -g TATAGAATTCGCGGCCGCTCGCGATAATACGACTCACTATAGGGCGTTTTTTTTTTTTTTTTTTTTTTTT -g ...
0
votes
0answers
167 views

Setting different path for installation in python packaging

I am new to python packaging. My Command Line Interface (CLI) named virtdc modules has to be installed in /var/lib/virtdc. virtdc is the top folder structure /var/lib/virtdc/ framework/ ...
0
votes
0answers
964 views

Dynamic search and replace in Ksh

Machines at work follow a constant naming pattern: host[domain]_[id] where [domain] is either "d" for dev machines and "p" for production machines, and [id] is a 2-digit string that is different for ...