Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:19:00+00:00 2026-06-18T06:19:00+00:00

I use z shell via oh my zsh. I’d like to source multiple alias

  • 0

I use z shell via “oh my zsh”. I’d like to source multiple alias files from within my .zshrc file so I can keep things well organized. I’ve prefixed the alias files with .alias_ so I can wildcard load them. But, a call to source ~/.alias_* only loads the first file. How can I script it to source multiple files?

Filename examples: .alias_git, .alias_local, .alias_server…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:19:01+00:00Added an answer on June 18, 2026 at 6:19 am

    Option 1

    You could use a for loop:

    for file in ~/.alias_*; do
        source "$file"
    done
    

    Option 2

    The other option is to build an array of all the files you want to source and then iterate over the array using a for loop.

    typeset -a aliases
    
    aliases+="~/.alias_foo"
    aliases+="~/.aliases_bar"
    # etc...
    
    for file in $aliases[@]; do
        if [[ -a "$file" ]]; then
            source "$file"
        fi
    done
    

    This can actually be quite effective in making a well organized zshrc setup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to be able to use FFmpeg to convert a video file from
I have a Java class which can be called from shell. (via java [command][options])
I would like to execute a command via Django's manage.py shell function solely from
I'd like to use a shell variable expansion inside of a git alias to
One can log into a remote shell via SSH, and one can use an
It seems like I can't use shell_exec or proc_open on my shared server. The
The following contents are in a file.i use a shell script to call a
To get the logcat from an Android device, I use adb shell logcat (also
I use shared hosting so I can't access to shell. I have CronsController and
I'm working on a project that essentially creates files via a shell script using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.