Questions tagged [alias]

In computing, an alias is an alternate name for an object, such as a variable, file or device.

Filter by
Sorted by
Tagged with
6 votes
2 answers
16k views

Setting up an alias for SSH command in Windows PowerShell

In Windows PowerShell: >ssh -i \Path\To\key.pem [email protected] Works like a champ. >Set-alias sshalias "ssh -i \Path\To\key.pem [email protected]" saves the alias with no errors. >sshalias ...
chrisphilton's user avatar
6 votes
1 answer
1k views

ssh: add "-X" to default options

How do I add "-X" into my ssh default option? i.e., when I type ssh A.B.C.D, it should really do ssh -X A.B.C.D I can alias it, but is there a more "elegant" solution to do that in .ssh/config file?
CuriousMind's user avatar
  • 1,981
6 votes
1 answer
1k views

How to pipe output of certain commands to a pager with zsh?

I am frequently working with subversion in console using its client svn. One of common tasks is viewing svn log; however its output is usually pretty massive despite of --limit option. I would like to ...
ulidtko's user avatar
  • 2,946
6 votes
1 answer
547 views

Set PowerShell Aliases with a script

I created a PowerShell script to set aliases for a PowerShell session. When I run the script and try the alias, I get the error saying that the alias isn't recongized. How can I use the aliases that ...
thecomputerguru's user avatar
6 votes
2 answers
904 views

Aliases with numerical names

I just installed Oh My ZSH on my Mac. Everything is working great, except I can't define aliases with numerical names. If I execute alias 5="cd ~/Projects/Projectname/" 5 I get the following error ...
user avatar
6 votes
1 answer
5k views

Is there a aliases file for sSMTP?

I installed sSMTP for sending emails from command line. I want to create some alias for cron jobs: $ sudo vim /etc/aliases # append this line at the end myname: root $ newaliases newaliases:...
kev's user avatar
  • 12.8k
6 votes
2 answers
3k views

Create an alias to a samba share from the command line

I'm currently wanting to deploy a setup to around 300 Macs. I have all of it scripted and ready to deploy, excepting that I'm having trouble creating a working alias to a samba share from the command ...
Matthieu Cartier's user avatar
5 votes
3 answers
18k views

How to alias a hostname?

Is it possible to keep a network alias - without specifying the IP address in the hosts file? For instance, I have abcd.efgh.com but want abcd -> abcd.efgh.com so that ping and ssh work as they ...
Jonas Byström's user avatar
5 votes
4 answers
3k views

Space in doskey/alias for windows?

I try to run Laravel's Artisan command inside the (docker) container by defining a doskey alias. My idea was: php artisan=docker-compose exec apache php artisan $1 However it does not allow me to ...
Thomas's user avatar
  • 559
5 votes
1 answer
2k views

How to make bash alias invocation conditional on PWD?

I currently have this alias: alias cmakerel='cmake -DCMAKE_BUILD_TYPE=Release -Wno-dev ../../ && make -j4' Essentially, it will call cmake to do an out-of-source build from PWD. It works ...
kfmfe04's user avatar
  • 925
5 votes
3 answers
3k views

How do I close an OS X application from the command line using a alias defined in my .bash_profile?

I found the following shell script that can be used to tell an OS X application to quit: #!/bin/sh echo | osascript <<EOF tell application "$*" quit end tell EOF I have several simple alias ...
Michael Prescott's user avatar
5 votes
2 answers
13k views

How to save user made zsh shell functions and aliases

Shell beginner here! I'd like to create aliases and functions in zsh shell to speed up my workflow. For example: tw() { open -a //Applications/Textwrangler.app "$*"; } The function itself works, but ...
Juho Karppinen's user avatar
5 votes
1 answer
2k views

Alias defined in .bashrc not working after pipe

I'm stuck with the following problem. I've defined an alias in .bashrc (and .bash_profile): alias echo2="echo" This works well: $ echo2 "test" test However, if I try to use it after a redirect, ...
Eino Gourdin's user avatar
5 votes
1 answer
23k views

How to set alias for python3 on OSX

I'm trying to set an alias for python3 so I can run it with python. Here's my current .bash_profile # Setting PATH for Python 3.6 # The original version is saved in .bash_profile.pysave PATH="/...
Noah Kiss's user avatar
5 votes
1 answer
2k views

What does "network" mean in the /etc/network/interfaces file?

In Linux, to define aliases, we have to modify /etc/network/interfaces.. Something like this: auto eth0:1 iface eth0:1 inet static address 192.168.1.60 netmask 255.255.255.0 network x.x.x.x ...
Kumar's user avatar
  • 81
5 votes
3 answers
2k views

Do aliases slow down a shell's start?

Sometimes my shell (zsh) takes longer to start than usual (I open the terminal, and it hangs a bit until I can input commands). I have a few aliases on my .zshrc (well, actually they're in a ...
user137369's user avatar
  • 1,073
5 votes
2 answers
2k views

How to create shortcut command in Mac

I would like to a shortcut command in Mac as I frequently call commands that are a bit long in Terminal. How can I do that?
Tam's user avatar
  • 243
5 votes
1 answer
4k views

Define custom aliases for outlook contacts

I have a close coworker whom I email almost daily. Let's call her "Leigh Wilson". The global address book at my company has several other people with the first name "Leigh" and/or the last name "...
Matt McHenry's user avatar
4 votes
5 answers
2k views

error when using commandline as a bash alias on linux

I want to save the following commandline sequence as a bash alias: grep `date '+%d/%b/%Y'` access.logs | egrep 2765330645ae47d292c9ceac725d744e.py |awk '{print $1, $4, $5, $7, $8, $9, $10}' | sort |...
cfischer's user avatar
  • 9,063
4 votes
1 answer
5k views

Echoing aliases into a .bashrc file

I want to echo an alias straight into my .bashrc file. Here is what I am using: echo alias cdear='cd | clear' >> .bashrc However, the new line in .bashrc does not contain the quote marks. I ...
user328721's user avatar
4 votes
2 answers
5k views

How to undo alias, PATH=$PATH:./Test - (Unix)

1.) In a terminal when we make an alias for any command line,the life of that alias is as long as the terminal is open. alias new_command=old_command example: alias dog=cat But can we explicitly ...
Pavitar's user avatar
  • 461
4 votes
1 answer
5k views

Sending email from domain name address

hey, I've just bought a domain name and would like to send emails from [email protected]. I can use an alias from my hotmail/gmail account, but the recipient sometimes sees it as "[email protected] on ...
XSL's user avatar
  • 129
4 votes
3 answers
5k views

Where are aliases set in CentOS?

There is a typo which causes an error message upon logon (someone typed lias instead of alias). I have checked /etc/bashrc as well as ~/.bashrc and /etc/profile as well as ~/.bash_profile for ...
Shouvik Sayef's user avatar
4 votes
1 answer
7k views

Stop sending mail to myself when choosing Reply All in Outlook

My company has set up each mail account with serveral aliases. My default account is [email protected]. I also have: [email protected] [email protected] [email protected] The ...
Josh's user avatar
  • 195
4 votes
3 answers
4k views

Can I change the "From" name and address without going into Mail.app's preferences?

Can I somehow add an editable "From" field to Mail.app, a bit like Virtual Identity for Thunderbird, just like I could change the "Reply To" address on the fly? In Mail.app, one can set up multiple ...
Arjan's user avatar
  • 31.2k
4 votes
2 answers
3k views

Windows 10 App Aliases not working

I have a number of different apps installed on my Windows 10 computer that use the App Execution Aliases feature (Settings -> Apps and Features -> App Execution Aliases). However, with the ...
BarrowWight's user avatar
4 votes
3 answers
947 views

How can I make "and" be a working alias for && in Bash?

I want to be able to use and instead of && in Bash. I tried alias and=&& but the behavior is not the same. steven% echo 'hi' && echo 'bi' (git)-[yako.botrank-rate-limit-...
Daniel Jacobson's user avatar
4 votes
1 answer
1k views

Screen does not read /etc/profile.d on startup

Whenever I start screen, my alias definitions in /etc/profile.d are missing within screen. How can I make screen read/source all files in /etc/profile.d/ on startup?
moestly's user avatar
  • 246
4 votes
2 answers
2k views

How do I handle multiple quotes in an alias (for bash or zsh)

I am using zsh, and I am trying to use python as a simple calculator. I'm very familiar with python, but can't seem to get the alias (or function) to work properly. So far I've got: pycalc() { ...
AtHeartEngineer's user avatar
4 votes
1 answer
417 views

Dynamically creating aliases in PowerShell

I'd like to create some aliases dynamically but I can't get my code to work. Here's the code: # Drives $drives = ("a","b","c","d","e") foreach ($drive in $drives) { New-Item -Path alias:\ -Name $...
prubini87's user avatar
  • 155
4 votes
3 answers
14k views

How to create domain "alias" for entire url?

I have set up a DNS server for local use in a LAN. This server can resolve IP addresses, so when I ping mypc.company I get a successful reply from the IP address 192.168.1.34. Problem I have ...
Kaleb's user avatar
  • 151
4 votes
1 answer
2k views

In MacOS X is there a way to create a shortcut to a folder on a readonly drive?

I have a partitioned drive with a different OS on my Mac. I can access this drive in readonly mode, but not write mode. There is a folder on this partition drive that I often open, and therefore I ...
wip's user avatar
  • 7,084
4 votes
3 answers
2k views

Powershell - How can I locate where Aliases and Functions are defined?

Background At some point in time, I know I created a file that defines some functions and assigns aliases to them. These are available in all powershell instances. The problem is, I can't for my life ...
Erik W. Gren's user avatar
4 votes
1 answer
4k views

Create aliases dynamically

I want to create aliases based on a command, its subcommands and its options. I'd like the alias to be the acronym of those components. This is simpler to explain with the real example: alias mc="...
Andrea Bergonzo's user avatar
4 votes
2 answers
9k views

How to alias a directory change in Powershell?

Why does Set-Alias foo "cd C:\foo\bar\xyz\asdf\etc" not work? foo -> invalid format How to do this correctly?
Tobias's user avatar
  • 149
4 votes
3 answers
197 views

How do I force an application to recognise two names for a disk drive?

I have an extensive image database (3.25GB metadata, 90K images) held in a legacy product (idImager V5). This in turn utilises SQL Server 2005 as the underlying DBMS. Over time, I have been adding ...
Chris Walton's user avatar
4 votes
1 answer
606 views

Is there an OSX/macOS CLI command for creating a Finder Alias?

For clarification on the ambiguous word ALIAS in this question. While using Finder (of OSX/MacOS) for generic file operations, and secondary-clicking on a file or folder, a pop-up menu (some refer to ...
Keve's user avatar
  • 175
4 votes
2 answers
2k views

OS X: is there an application that can check for broken aliases in Finder? [closed]

I use a lot of aliases in my file system. Many original documents are placed in global repositories and I access them by aliases grouped in "tag" folders. Therefore, when I need to delete such a ...
4ae1e1's user avatar
  • 1,626
3 votes
9 answers
21k views

Command to search programs in Linux

Do you have any easy idea to define some alias in .bashrc for finding some command that you want to search (when you forgot its name) in your machine, visiting all "bin" directories, maybe using regex?...
user avatar
3 votes
5 answers
4k views

bash alias for "cd directory; ls"

How do I create BASH alias for: I type in cdd directory and what that does is cd directory and then ls?
funk-shun's user avatar
  • 2,623
3 votes
2 answers
23k views

How can I add password of user as alias in bashrc file?

I have created alias for username and it works fine alias yb="ssh name@hostname" It works fine, but I also want to create alias for password, Can anyone help how can I do this?
Ramesh Kumar's user avatar
3 votes
3 answers
8k views

Syncing aliases via Dropbox and having them work on both Macs

I'm currently syncing my Desktop folder between two Macs using Dropbox. The Desktop folder in my Mac's user folder is an alias to the folder in my Dropbox. This works fine. On one Mac, I created an ...
shedd's user avatar
  • 163
3 votes
4 answers
7k views

Quick Mac OS X shut-down icon

How would I create an icon on my Mac OS X desktop, to do a "shut down"? (With... or without... the "are you sure" verification.)
user avatar
3 votes
1 answer
3k views

how to put my arguments into a Bash alias command?

i usually have the following simple alias in my bashrc: alias g="grep --color=always --exclude-dir=\*.svn\*" but now i have to work on systems that only have GNU grep 2.5, hence no --exclude-dir ...
gcb's user avatar
  • 4,941
3 votes
1 answer
2k views

Alias options in zsh

When using the zsh alias command, what does the -s flag do (for example, lines 83-87 of oh-my-zsh's common-alias plugin?
raisin's user avatar
  • 33
3 votes
2 answers
114 views

Is there a way to tell the shell (zsh preferably) about a command?

I defined an alias: alias school="cd ~/School/3BaFys/" to quickly go to the folder 3BaFys which contains all of the directories I need this year. Is there a way to tell zsh that when I do: $school ...
romeovs's user avatar
  • 309
3 votes
1 answer
4k views

How does \cp work?

I know that if you have some alias with the name cp, you can bypass it using \cp. Is this unix syntax? Are there any other uses of this syntax?
Lazer's user avatar
  • 17.7k
3 votes
2 answers
895 views

Make :Wq equivalent to :wq in vim

I'm always typing :Wq when I mean :wq. Is there a way to alias :Wq=':wq' in vim?
isomorphismes's user avatar
3 votes
4 answers
3k views

How to write alias to use first parameter or * if parameter is blank?

I want to write an alias command for 'ls', so that if I pass in a parameter, then the alias will use it, but if I do not, then it would use '*' instead. This is the alias I have today: alias lsd='ls -...
Peter's user avatar
  • 320
3 votes
1 answer
1k views

Create aliases in PowerShell

I want to create a permanent alias in PowerShell for all executables located within Cygwin's bin directory: C:\Cygwin64\bin I can do it for individual executable like grep via: Set-Alias grep "...
susik's user avatar
  • 653

1
2
3 4 5
8