• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Archives for command line

command line

Automatically Switch Node Version in Zsh from package.json

Last updated on January 12, 2023 by Sal Ferrarello

Add this code to $HOME/.zshrc to automatically set the node version to match the version in package.json.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: command line, jq, node, nvm, zsh

Quickly Delete Large Directory from the Command line

Last updated on April 23, 2022 by Sal Ferrarello

When deleting a large directory from the command line, it can take a frustratingly long time for the task to complete. This is a trick I use to speed things up.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line

Using jq and nvm to set Node version

Last updated on March 3, 2022 by Sal Ferrarello

The nvm command allows you to switch between versions of node. Often a project will include a .nvmrc file to specify the version of node to use. Even if a project does not contain an .nvmrc file, you may be able to read the preferred node version from package.json and use that value with nvm.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: command line, jq, node, nvm

Remove newline at end of text file

Last updated on February 10, 2022 by Sal Ferrarello

Sometimes when I’m working with files in Git, I find myself with a change in a file that says “No newline at end of file”. This occurs when my editor adds the missing newline at the end of the file. While you should have a newline at the end of the file, you may have a reason for not wanting to add this change. In that case, you can remove the newline from the end of the file.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution Tagged With: command line, Git

Writing Posts with CLI Commands

Last updated on March 1, 2021 by Sal Ferrarello

A lot of the posts I write include command-line interface (CLI) commands to type in. I’ve found over time there are things I can do to improve how these commands are communicated.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Presentation, Recommendations Tagged With: blogging, command line, website

Add git status to zsh prompt

Last updated on December 29, 2020 by Sal Ferrarello

One of the things that made me much better at Git was making my current branch (and whether or not I have any changed files) always visible. By default zsh includes everything you need to do this, you just need to configure it.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Recommendations, Solution Tagged With: command line, Git, zsh

Add a Blank line at the Beginning of Command Line Prompt

Last updated on October 26, 2020 by Sal Ferrarello

While there are many ways to customization your command line prompt, one that can help readability is adding a blank line at the beginning of each prompt.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Bash, command line, zsh

Curl Examples Posting Data and Displaying Headers

Last updated on October 1, 2019 by Sal Ferrarello

Curl is a fantastic tool for making web requests from the command line. As a developer, I find this tool particularly useful. Retrieve Content at a URL curl https://salferrarello.com/ Making a HEAD Call Sometimes, we want to see the Header Values returned from a URL using the HEAD. The HTTP HEAD method requests the headers […]

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft Tagged With: command line, curl

Git Previous Branch

Last updated on March 18, 2023 by Sal Ferrarello

When working with Git on the command line, I spend a lot of time switching back and forth between two branches. Even with Git tab completion, it is a lot of typing. However Git has a shortcut for the previous branch, a single dash (-).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Recommendations Tagged With: command line, Git

Curl Get Redirect

Last updated on September 25, 2018 by Sal Ferrarello

When creating 301 redirects, I often want to check multiple URLs quickly from the command line (to avoid the manual clicking in the browser and browser caching of results). I’ve written this script to speed up my process.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: command line, curl, redirects

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Next Page»

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in