10/12/2021 0 Comments Best Bash Alias Setup For Mac
Sublime Text subl /.bashprofile Atom atom /.bashprofile The next several sections will have you add to the. Before clicking OK to connect to the server, go to the connection menu in PuTTY, select SSH, X11 and tick the box X11 forwarding. Split your terminal into multiple panes which you can switch by hotkeysOpen PuTTY as normal, filling in the IP address or DNS alias name. Copy the definition to /.bashrc on the other machine. The output of type ll gives you the definition of the alias, or you can look for it in your shell configuration file (/.bashrc if your shell is bash). Run type ll to see where the ll command is coming from.ll is not a standard command, but many distributions predefine it to an alias for ls with some preset options.Bashprompt file is going to contain the commands to set a custom bash prompt. Register a hotkey that brings the terminal to the foreground when you’re in another applicationStep 4: Configuring. This isnt something youll be doing often while developing, but getting things set up properly will feel good.
![]() Autocompletion by pressing Tab key which allows selecting available directories, commands and files. You can enrich ZSH by using the Oh My ZSH framework which provides some functionality that will boost your productivity: Paste history that shows everything you’ve pasted into the terminalSince macOS Catalina (10.15.2) the default shell is now ZSH instead of Bash. Different user profiles to save your window arrangements and more Having a web server ready to go upon first boot etc. take command creates a new directory and changes the path to it. /.) / (for root directory) and ~ (for home directory) You can omit the cd (change directory) command. Plugins = ( git# Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. # See ZSH_THEME = "avit" # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-zsh is loaded. Export ZSH =/Users/mhoffman/.oh-my-zsh# Set name of the theme to load. Export PATH = $HOME/bin:/usr/local/bin: $PATH export JAVA_HOME = "/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/" # jenv export PATH = " $HOME/.jenv/bin: $PATH" eval " $(jenv init - )" # Path to your oh-my-zsh installation. Use - to quickly navigate between your last and current pathYou can install it using this terminal command:# If you come from bash you might have to change your $PATH. Best Bash Alias Setup Full List Ofnpm: provides completion as well as adding many useful aliases for npm. docker: adds auto-completion for docker. brew: adds several aliases for common brew commands. git: provides many aliases and a few useful functions for git. Alias zshconfig = "nano ~/.zshrc" alias ohmyzsh = "nano ~/.oh-my-zsh" alias gpf = 'git push -f' # Docker alias alias dkps = "docker ps" alias dkst = "docker stats" alias dkpsa = "docker ps -a" alias dkimgs = "docker images" alias dkcpup = "docker-compose up -d" alias dkcpdown = "docker-compose down" alias dkcpstart = "docker-compose start" alias dkcpstop = "docker-compose stop" # Kubectl alias alias kdev = 'kubectl -n dev' alias kpg = 'kubectl -n playground' alias ktest = 'kubectl -n test' alias kprod = 'kubectl -n prod' alias kpreprod = 'kubectl -n preprod'I use the avit theme but there are many other cool themes available.Some words about the used plugins, here you can find a list of all available Oh My ZSH plugins: # For a full list of active aliases, run `alias`. After installing the font on your operating system you need to select it as a font in your iTerm profile:In this chapter I want to demonstrate some CLI tools which I regularly use in my terminal and which can highly increase your productivty: Installation instructions can be found here.The result should look similar to my terminal:Choose Minimal theme to have a cleaner UI with smaller tabs as shown in the screenshot above:Minimal Theme Setting Change font to Cascadia FontI use the Cascadia Font from Microsoft in iTerm. zsh-syntax-highlighting: provides syntax highlighting for the shell zsh, red for invalid and green for valid commands:Invalid ZSH syntax highlighting Valid ZSH syntax highlightingI really like Material Design so I also use it in iTerm thanks to this iTerm2 color scheme. zsh-autosuggestions: suggests commands as you type based on history and completions web-search: adds aliases for searching with Google, Wiki, Bing, YouTube and other popular services. Midnight Commander: a visual file manager htop: “an interactive process viewer for Unix systems”, which I use instead of the macOS Activity Monitor.app htop HTTPie: a command line HTTP client with an intuitive UI, JSON support, syntax highlighting, wget-like downloads, plugins, and more which I often use instead of graphical programs like Postman or Insomnia HTTPie Using the terminal more often I could reduce the time I need to grab my mouse and many operations can be done much faster using the CLI than using a graphical interface. ConclusionI am still at the beginning of my terminal journey but I really enjoy it so far. watch: Linux watch command, which is really helpful to run commands at a regular intervalI highly recommend the free Command Line Poweruser course from Wes Bos if you want to learn more about ZSH. kubectl: Kubernetes command-line tool to run commands against Kubernetes clusters bat: a cat clone with syntax highlighting and Git integration
0 Comments
Leave a Reply. |
AuthorDenise ArchivesCategories |