Need Advice? CALL: +61 417949565

Riksi - web design and development

  • Home
  • ABOUT US
  • OUR WORK
  • BLOG
  • CONTACT US
  • Home
  • BLOG
  • Web developing
  • command line
  • Create and Use Alias Command in Mac os &Linux

Create and Use Alias Command in Mac os &Linux

Create and Use Alias Command in Mac os &Linux

Sometimes you need to use a long command over and over again, and type it every time is a big pain.

You can save a lots of time by using the “alias” command.

1
2
3
4
5
 
 
alias short_name="custom command"
 
 

For instance, if you need to switch between directories, you can add each to the alias and run the shortcode.

1
2
3
4
5
6
 
 
alias p1="cd /path/to/first/directory"
alias p2="cd /path/to/second/directory"
 
 

From now, you can type p1 to go to first directory and p2 to go to second directory.
you can also check the defined alias in the system by typing this

1
2
3
4
5
 
 
alias
 
 

Please note: alias created are session based and temporarily and will be deleted after you close the terminal.

To save them and use the shortcode in future, you need to add them into Bash file or one of the following paths:

  • Bash – ~/.bashrc
  • ZSH – ~/.zshrc
  • Fish – ~/.config/fish/config.fish

Open the .bashrc file and add the alias at the end of it.

Access the windows file via ubuntu

To access the windows file, you need to go to “mnt” folder

1
2
3
4
5
 
 
cd /mnt/c
 
 
Tagged under: trick
Nick
Wednesday, 19 June 2019 / Published in command line

What you can read next

Kill the in-used TCP port on mac
Update the $Path file in Mac
Git: LF will be replaced by CRLF

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archive

  • General
    • Smart Home
  • Web developing
    • command line
    • CSS
    • General
    • git
    • Javascript
    • Laravel
    • Magento
    • MySQL
    • PHP
    • Security
    • Shopify
    • Wordpress

Recent Posts

  • Install HomeAssistant on Raspberry pi

  • Shopify ERR_INVALID_ARG_TYPE Error

Riksi

Riksi is a creative, professional & cutting-edge custom web design and development company.

HERE TO HELP

  • BLOG
  • Contact Us
  • Our Work
  • About Us

New on Blog

  • Install HomeAssistant on Raspberry pi

    To install it, We need to connect the SD card t...
  • Shopify ERR_INVALID_ARG_TYPE Error

    fix the Internal Server Error occurred while in...

GET IN TOUCH

T: (+61) 417 949 565
Email: [email protected]

Contact Us
Fill out the form and our team will be in touch with you promptly. Thank you for your interest!

AU & NZ
T: (+613) 9014 9495
T: (+61) 417 949 565
Email: [email protected]


US & Canada
Email: [email protected]

NAME

EMAIL

PROJECT TYPE
PROJECT BUDGET

MESSAGE

Could not authenticate you.

Whats on Instagram

Loading...

Tags

.htaccess calculation cherry pick composer content css deployer documentation error flex general knowledge get started git git stash hack javascript log mysql package password php PHP Trick replace scss shopify sidebar ssh symlink sync trick ubuntu windows 10 wordpress trick wp
  • GET SOCIAL
Riksi - web design and development

© 2020 All rights reserved. Riksi.com.

TOP