- Articles
- [7z] Compress files into a 7z archive on macOS
- [7z] Extract a 7z archive on Mac with 7z
- [7z] Install the 7z command on macOS with Homebrew
- [ack] Print only the names of matching files
- [ack] Read the list of files to search from standard input
- [ack] Search without matching case
- [Apache] Redirect HTTP requests to HTTPS with .htaccess
- [awk] Average the second column by the value in the first
- [awk] Calculate an average
- [awk] Count fields on each line with NF
- [awk] Count the lines in a file
- [awk] Filter rows by a numeric column
- [awk] Filter rows by the text in a column
- [awk] Find the maximum value in a column
- [awk] Find the minimum value in a column
- [awk] Get line numbers for each input file
- [awk] Get the last field of each line
- [awk] Get the length of a string
- [awk] Join two files by a shared key
- [awk] Print a specific input line
- [awk] Print lines between two patterns
- [awk] Print text without a newline after each record
- [awk] Remove duplicate lines while keeping input order
- [awk] Reorder columns
- [awk] Replace all matches on a line with gsub
- [awk] Select a column using an input delimiter
- [awk] Set the output field separator
- [awk] Skip the rest of the current record with next
- [awk] Split a string into fields with split()
- [awk] Sum numbers from standard input
- [AWS CLI] Add an attribute to an existing DynamoDB item
- [AWS CLI] Add multiple items to a DynamoDB table in one batch
- [AWS CLI] Check which AWS identity the CLI is using
- [AWS CLI] Download an S3 prefix with its directory name
- [AWS CLI] Generate a presigned URL for an S3 object
- [AWS CLI] Get a single item from DynamoDB
- [AWS CLI] Put a DynamoDB item from a JSON file
- [AWS CLI] Put an item in a DynamoDB table
- [AWS CLI] Query a DynamoDB global secondary index
- [AWS CLI] Resolve an Invalid base64 error when running aws lambda invoke
- [AWS CLI] Show only file names with aws s3 ls
- [AWS SAM] Install the AWS SAM CLI on macOS with Homebrew
- [AWS SAM] Read a value from Secrets Manager in a template
- [AWS SAM] Run a Lambda function on an EventBridge schedule
- [AWS SAM] Skip the change set confirmation during deployment
- [basename] Get the final filename component of a path
- [Bash] Append an element to an array
- [Bash] Capture command output in a variable
- [Bash] Check for a regular file with -f
- [Bash] Check whether a command is available
- [Bash] Check whether a directory exists with -d
- [Bash] Check whether an array contains an element
- [Bash] Count command-line arguments
- [Bash] Create an associative array
- [Bash] Delete a specific shell history entry
- [Bash] Detect a failure anywhere in a pipeline
- [Bash] Evaluate a string as a shell command
- [Bash] Exit early after a command fails with set -e
- [Bash] Extract a substring by offset and length
- [Bash] Generate a UUID
- [Bash] Generate a UUID
- [Bash] Get the last element of an array
- [Bash] Get the number of elements in an array
- [Bash] Join array elements with a delimiter
- [Bash] Loop over array elements (foreach)
- [Bash] Perform arithmetic
- [Bash] Print an indexed array in reverse order
- [Bash] Read a file one line at a time
- [Bash] Read file lines into an array
- [Bash] Read one line from standard input
- [Bash] Read positional command-line arguments
- [Bash] Read regular expression capture groups from BASH_REMATCH
- [Bash] Read the first element of an indexed array
- [Bash] Remove an array element with unset
- [Bash] Remove the last extension from a filename
- [Bash] Repeat a command with a for loop
- [Bash] Split a delimited string into an array
- [Bash] Store the output of ls in an array
- [Bash] Take a range of elements from an array
- [Bash] Test for a non-empty string with if -n
- [Bash] Test whether a string ends with a suffix
- [Bash] Test whether a string is empty
- [Bash] Test whether a string is non-empty
- [Bash] Test whether a string starts with a prefix
- [Bash] Treat unset variables as errors with set -u
- [Bash] Use a default value when a variable is unset or empty
- [Bash] Why shell variable expansions need double quotes
- [Bash] Write multiple lines to a file with a here document
- [BigQuery] Convert a date-time string to a TIMESTAMP
- [BigQuery] Format Unix seconds as a date and time
- [cat] Display line numbers
- [CentOS] Disable SSH logins as root
- [CentOS] Disable SSH password authentication
- [Composer] Update Composer
- [curl] Add a header to a request
- [curl] Check the HTTP status from the response headers
- [curl] Follow HTTP redirects
- [curl] Limit the time allowed for an HTTP request
- [curl] Retry failed HTTP requests
- [curl] Send an HTTP Basic authentication request
- [curl] Treat an HTTP error response as a failed command
- [cut] Extract the first characters of a line
- [date] Get the current date and time in a specified format
- [dirname] Get the directory portion of a path
- [Docker] Assign host ports automatically
- [Docker] Look up a container's IP address
- [Docker] Remove all containers that are stopped
- [Docker] Remove local images by ID
- [Docker] Start a local MySQL container for testing
- [echo] Print a string without a trailing newline
- [FFmpeg] Convert SVG to PNG
- [find] Delete files that match a search
- [find] Exclude a directory from a search
- [find] Exclude shallower paths with -mindepth
- [find] Find empty regular files
- [find] Find files by modification time
- [find] Find files larger than a specified size
- [find] Find files modified after a date or time
- [find] Find files modified within the last few minutes
- [find] Limit search depth with -maxdepth
- [find] Search for files by their permission bits
- [fish] Hide the timestamp in the right prompt
- [fish] Set and export an environment variable
- [gawk] Extract text matched by a regular expression capture group
- [Git] Add a message when creating a stash
- [Git] Apply a patch created with git diff
- [Git] Apply stashed changes and keep the stash entry
- [Git] Bring a file over from another branch
- [Git] Bring another branch's changes into the current branch
- [Git] Check a diff for whitespace errors
- [Git] Cherry-pick a range of commits
- [Git] Combine search patterns with AND in git grep
- [Git] Compare a stash with the current HEAD
- [Git] Create and check out a branch at a specific commit
- [Git] Delete a local branch with git branch -d
- [Git] Delete a specific stash entry
- [Git] Display commit history as a graph
- [Git] Download remote updates with git fetch
- [Git] Edit the latest commit message
- [Git] Fetch and integrate remote changes with git pull
- [Git] Find commits that changed the count of a string
- [Git] Find the commit hash for a reference such as HEAD~n
- [Git] Find the root directory of the working tree
- [Git] Get the current branch name as plain text
- [Git] Get the current commit hash
- [Git] Get the current commit hash
- [Git] Include untracked files in a stash
- [Git] List branches
- [Git] List branches that have been merged
- [Git] List changed files
- [Git] List files on a specific branch
- [Git] List tags
- [Git] List the files tracked in the index
- [Git] Preview which untracked files git clean would remove
- [Git] Print only the names of files that match git grep
- [Git] Rebase a branch onto another with git rebase
- [Git] Rename a local branch with git branch -m
- [Git] Reset the current branch to match a remote branch
- [Git] Restore a file or unstage it with git restore
- [Git] Restore and remove a stash with git stash pop
- [Git] Restrict git grep to files with a particular extension
- [Git] Review staged changes with git diff --cached
- [Git] Search a specific revision with git grep
- [Git] Search case-insensitively with git grep
- [Git] Send local commits to a remote with git push
- [Git] Show file status in a compact format
- [Git] Show line numbers with git grep
- [Git] Show stash diffs with git stash show -p
- [Git] Show the commit message at HEAD
- [Git] Show the contents of a file on another branch
- [Git] Sort tags by version
- [Git] Summarize changed files and line counts with git diff --stat
- [Git] Switch back to the previously checked-out branch
- [Git] Switch branches with git switch
- [Git] Undo a commit with git revert
- [Git] Unstage changes added with git add
- [Git] Use Vim as Git's editor
- [GitHub Actions] Run a workflow on a schedule
- [GitHub Actions] Set a job timeout in minutes
- [GitHub Actions] Share an environment variable between steps
- [GitHub] Resize an image in an issue or pull request
- [Gmail] Filter email by date
- [Go] Add calendar days to a date
- [Go] Add or subtract seconds from a time.Time value
- [Go] Append an element to the end of a slice
- [Go] Assert that a slice contains a value with Testify
- [Go] Assign to a nested map without a nil map panic
- [Go] Check an expected value with Testify's assert.Equal
- [Go] Check how many times a mock method was called with Testify
- [Go] Check slice elements in any order with assert
- [Go] Check whether a map contains a key
- [Go] Check whether a string contains a substring
- [Go] Check whether a string ends with a specific suffix
- [Go] Check whether a string starts with a prefix
- [Go] Check whether a time.Time value is zero
- [Go] Check whether an interface value satisfies another interface
- [Go] Concatenate two slices with append
- [Go] Convert a byte slice to a string
- [Go] Convert a string to a byte slice
- [Go] Convert a string to an int
- [Go] Convert a uint32 to a string
- [Go] Convert a Unix timestamp to a time.Time
- [Go] Convert an int to a string
- [Go] Convert an int to an int64
- [Go] Convert an int64 to a string
- [Go] Convert an int64 to an int
- [Go] Count Unicode code points in a UTF-8 string
- [Go] Declare an array
- [Go] Decode a Base64 string
- [Go] Define a function
- [Go] Define a struct
- [Go] Define an interface
- [Go] Download an image from a URL and save it to a file
- [Go] Encode bytes as Base64
- [Go] Format a time as a string
- [Go] Generate a presigned URL for an S3 object with aws-sdk-go
- [Go] Generate a random UUID
- [Go] Get capture groups from every regular expression match
- [Go] Get the current Unix timestamp
- [Go] Get the day of the week
- [Go] Get the name of a time zone
- [Go] Join strings with a separator
- [Go] List a struct's methods with reflection
- [Go] List entries in a directory
- [Go] Load a YAML file into a struct
- [Go] Load JSON from a file into a struct
- [Go] Pad a number with leading zeros
- [Go] Parse a date string in a specified time zone
- [Go] Parse a date-time string into time.Time
- [Go] Pass parameters to a MySQL query with database/sql
- [Go] Post a message to Slack with chat.postMessage
- [Go] Prepend elements to a slice
- [Go] Read a command-line flag with the flag package
- [Go] Read a CSV file
- [Go] Read an environment variable
- [Go] Read an io.ReadCloser into a string
- [Go] Read an S3 object with the AWS SDK for Go v2
- [Go] Read the results of a MySQL SELECT query
- [Go] Remove an element from a slice by index
- [Go] Return different GoMock values for different arguments
- [Go] Round a number up to the nearest integer
- [Go] Round to the nearest integer with math.Round
- [Go] Run go test without reusing cached results
- [Go] Run one test by name with go test -run
- [Go] Run selected tests with go test -run
- [Go] Send a POST request with a JSON body
- [Go] Send a SigV4-signed HTTP request to API Gateway with aws-sdk-go-v2
- [Go] Send an HTTP GET request
- [Go] Send an HTTP request with Basic authentication
- [Go] Set a mock method's return value with GoMock
- [Go] Show output from passing tests with go test -v
- [Go] Sort a slice
- [Go] Sort a slice of strings alphabetically
- [Go] Split a string at a separator
- [Go] Upload a string as a text file to S3
- [Go] Upload an image with the legacy Slack API
- [Go] Use a struct as a map key
- [Go] Use a switch statement
- [Go] Use an anonymous struct
- [Go] View a time.Time in a different time zone
- [Go] Wrap a string in an io.ReadCloser
- [Go] Write a built executable to a specific location
- [Go] Write CSV records to a string
- [Go] Write records to a CSV file
- [Google Apps Script] Append a row to a Google Sheet
- [Google Apps Script] Build a line chart from an array
- [Google Apps Script] Clear all values and formatting from a sheet
- [Google Apps Script] Create an event in Google Calendar
- [Google Apps Script] Download an image and save it to Google Drive
- [Google Apps Script] Encode a string in Base64
- [Google Apps Script] Fetch a public image as a blob
- [Google Apps Script] Get a Sheet object by name
- [Google Apps Script] Get a Spreadsheet object by ID
- [Google Apps Script] Get daily page views from Universal Analytics
- [Google Apps Script] List the events on a calendar for one day
- [Google Apps Script] Parse a CSV string
- [Google Apps Script] Parse a JSON string
- [Google Apps Script] Parse a TSV string
- [Google Apps Script] Read a web app query parameter
- [Google Apps Script] Read values from a spreadsheet range
- [Google Apps Script] Replace the body text of a Google Doc
- [Google Apps Script] Send a POST request with a JSON body
- [Google Apps Script] Send an email with CC and BCC recipients
- [Google Apps Script] Send email with an attachment
- [Google Apps Script] Send email with MailApp
- [Google Apps Script] Upload an image to a Slack channel
- [Google Sheets] Check whether a cell contains text
- [Google Sheets] Convert a Unix timestamp to a date and time
- [Google Sheets] Count cells that contain values
- [Google Sheets] Count the days between two dates
- [grep] Count matching lines
- [grep] Exclude directories when searching recursively
- [grep] Match whole words with grep -w
- [grep] Print only text that matches a regular expression
- [grep] Print only the names of files with a match
- [grep] Search a binary file as text with grep -a
- [grep] Search a directory and its subdirectories
- [grep] Search for a literal string
- [grep] Show line numbers for matches
- [grep] Show lines before and after a match
- [grep] Show only lines that do not match
- [grep] Stop after a specified number of matching lines
- [head] Print the first N lines
- [Homebrew] List installed formulae
- [Homebrew] List installed formulae and their versions
- [JavaScript] Check whether an array includes a value
- [JavaScript] Combine arrays with concat()
- [JavaScript] Copy part of an array
- [JavaScript] Create a Date from a Unix timestamp
- [JavaScript] Filter an array by a condition
- [JavaScript] Get a Unix timestamp in seconds
- [JavaScript] Parse an integer from a string with parseInt()
- [JavaScript] Remove an array element at a given index
- [JavaScript] Remove duplicate values from an array
- [jq] Avoid the startswith() requires string inputs error
- [jq] Base64-encode or decode a string inside JSON
- [jq] Build an object from an array of key-value entries
- [jq] Check whether a string ends with a suffix
- [jq] Check whether an object has a key
- [jq] Check whether at least one array element matches a condition
- [jq] Check whether every array element meets a condition
- [jq] Convert a JSON array to TSV
- [jq] Convert a string to a number
- [jq] Convert an object to an array of key-value entries
- [jq] Convert between ISO 8601 and Unix timestamps
- [jq] Convert JSON to CSV with @csv
- [jq] Count the elements of an array
- [jq] Delete a key from an object
- [jq] Exclude objects whose property contains a given string
- [jq] Extract named regular expression groups with capture
- [jq] Extract the keys of an object
- [jq] Find the first or last position of a value
- [jq] Find the minimum value in an array
- [jq] Flatten a nested array
- [jq] Generate a sequence of numbers with range
- [jq] Generate every combination from several arrays
- [jq] Get the maximum value in an array
- [jq] Group an array of objects by a property
- [jq] Handle conversion errors with try and catch
- [jq] Join array elements into a string
- [jq] Limit the number of results emitted by a filter
- [jq] Load a text file as a string with --rawfile
- [jq] Load JSON values from a file into an array with --slurpfile
- [jq] Output strings as plain text
- [jq] Parse a CSV file and convert it to JSON
- [jq] Parse a JSON string with fromjson
- [jq] Pass a shell variable as a string with --arg
- [jq] Pass JSON from a shell variable with --argjson
- [jq] Print each JSON value on one line
- [jq] Read a nested value from a path with getpath
- [jq] Read multiple JSON values into an array
- [jq] Remove duplicate elements from an array
- [jq] Remove null values from an array
- [jq] Rename an object key
- [jq] Replace every regular expression match with gsub
- [jq] Round numbers down or up with floor and ceil
- [jq] Select objects whose field value starts with a given string
- [jq] Select objects whose property contains a given string
- [jq] Set a value at a path with setpath
- [jq] Sort an array of objects by a property
- [jq] Split a string into an array
- [jq] Sum numbers
- [jq] Supply a fallback for false or null
- [jq] Swap the rows and columns of a nested array
- [jq] Test whether a string matches a regular expression
- [jq] Transform all values in an object with map_values
- [jq] Transform each element of an array with map
- [jq] Transform nested JSON values with walk
- [jq] Turn a JSON value into a JSON string with tojson
- [jq] URL-encode a string
- [jq] Use a filter result as the shell exit status
- [jq] Use if to filter objects by a condition
- [jq] Write a string without double quotation marks
- [ls] List file names one per line
- [ls] Sort files by size
- [ls] Sort files by their last modification time
- [macOS] Show hidden files in Finder
- [Make] Choose between values with ifeq
- [Markdown] Include backticks in inline code
- [Middleman] Create a list of articles for each tag
- [Middleman] Display a list of blog articles
- [Middleman] Read the tags assigned to a page
- [Middleman] Set the preview server port
- [MySQL] Add or subtract calendar days from a date
- [MySQL] Change the session time zone
- [MySQL] Check the AUTO_INCREMENT value for a table
- [MySQL] Check the current time zone settings
- [MySQL] Check the system and session time zones
- [MySQL] Convert a date and time between time zones
- [MySQL] Convert a date-time string to a Unix timestamp
- [MySQL] Convert a Unix timestamp to a date and time
- [MySQL] Convert a VARBINARY column to a string
- [MySQL] Format a date as a string
- [MySQL] Get the current connection ID
- [MySQL] Get the current Unix timestamp
- [MySQL] Get the last day of a month
- [MySQL] Get the number of days between two dates
- [MySQL] Get the number of days in a given month and year
- [MySQL] Join strings with CONCAT()
- [MySQL] List tables in a specific database
- [MySQL] Parse a date-time string with STR_TO_DATE()
- [MySQL] Select the first non-NULL value with COALESCE()
- [MySQL] Write one INSERT per row with mysqldump
- [Next.js] Generate a Next.js app in the current directory
- [Node.js] Check whether a file or directory exists
- [Node.js] Create a Date object for the current time
- [Node.js] Create a directory and its subdirectory together
- [Node.js] Delete a directory synchronously
- [Node.js] Delete a single S3 object
- [Node.js] Detect a missing object error from AWS.S3.getObject (AWS SDK for JavaScript v2)
- [Node.js] Generate a version 4 UUID
- [Node.js] Invoke Lambda with AWS SDK for JavaScript v3
- [Node.js] List entries in a directory
- [Node.js] Read an S3 object with AWS SDK for JavaScript v2
- [Node.js] Send a JSON POST request with Axios
- [npm] Install a specific version of a package
- [npm] Update npm
- [Oh My Fish] Find the user configuration file
- [Oh My Fish] Update Oh My Fish and its packages
- [osascript] Show a macOS notification from the command line
- [PHP] Append to a file with file_put_contents
- [PHP] Build a query string from an array
- [PHP] Change the time zone of a DateTime object
- [PHP] Check for errors after encoding or decoding JSON
- [PHP] Check whether a string contains another string
- [PHP] Check whether an array is a list
- [PHP] Convert a date string to a Unix timestamp
- [PHP] Count command-line arguments with $argc
- [PHP] Decode a JSON object with json_decode()
- [PHP] Decode JSON objects as associative arrays
- [PHP] Define a string with heredoc syntax
- [PHP] Encode an array or object as a JSON string
- [PHP] Escape special HTML characters
- [PHP] Extract one column from a multidimensional array
- [PHP] Filter an array with a callback
- [PHP] Format a number with thousands separators
- [PHP] Format a Unix timestamp as a date string
- [PHP] Get a file extension
- [PHP] Get the current Unix timestamp
- [PHP] Get the keys of an array
- [PHP] Get the last day of a month
- [PHP] Interpolate a variable in a heredoc string
- [PHP] Merge arrays
- [PHP] Pad a number with leading zeros
- [PHP] Parse a URL query string into an array
- [PHP] Pause execution for a number of microseconds
- [PHP] Read a CSV file
- [PHP] Read a positional command-line argument
- [PHP] Read an environment variable
- [PHP] Read command-line options with getopt()
- [PHP] Read the IP address of the connection
- [PHP] Read the raw HTTP request body
- [PHP] Remove empty array elements with array_filter
- [PHP] Remove line breaks from a string
- [PHP] Send a POST request with a JSON body
- [PHP] Sort a nested array by one field with usort
- [PHP] Sort an array by value and preserve its keys with uasort()
- [PHP] Sort an array with usort
- [PHP] Split a URL into its components
- [PHP] Use strict comparison with in_array()
- [ps] Sort processes by memory usage
- [Python] Check the exact type of an object
- [Python] Check whether a path exists
- [Python] Check whether a string contains a substring
- [Python] Check whether an object is an instance of a class
- [Python] Convert an int to a str
- [Python] Decode percent-encoded text with urllib.parse.unquote
- [Python] Extract a regular expression capture group
- [Python] Find each regular expression match and its position
- [Python] Generate a presigned URL for an S3 object with Boto3
- [Python] Iterate over indexes and values with enumerate()
- [Python] Parse named command-line options with argparse
- [Python] Percent-encode text with urllib.parse.quote
- [Python] Read a CSV file with the standard csv module
- [Python] Read command-line arguments with sys.argv
- [Python] Read query parameters from a URL
- [Python] Send an HTTP GET request
- [Python] Send an HTTP request with Basic authentication
- [q] Run SQL queries against a CSV file
- [Ruby] Display a DateTime with a different UTC offset
- [Ruby] Format a DateTime object as a string
- [sed] Append a line after a match
- [sed] Back up a file before editing it in place
- [sed] Delete blank lines
- [sed] Delete lines that match a pattern
- [sed] Extract text captured by a regular expression
- [sed] Insert a line before each matching line
- [sed] Omit a particular line by number
- [sed] Print a range of lines
- [sed] Print only lines where a substitution succeeds
- [sed] Reorder captured groups in a replacement
- [sed] Replace just the last occurrence on each line
- [sed] Replace text on a specific line
- [sed] Replace the first occurrence on each line
- [sed] Replace the second occurrence on each line
- [Shell command] Align simple CSV columns in the terminal
- [Shell command] Append a comma to each line with sed
- [Shell command] Calculate a SHA-256 hash with sha256sum
- [Shell command] Check whether a TCP port accepts a connection
- [Shell command] Check whether two lists contain the same lines
- [Shell command] Convert a Unix timestamp to a date and time on Linux
- [Shell command] Convert text to lowercase with awk
- [Shell command] Convert text to uppercase with awk
- [Shell command] Convert uppercase letters to lowercase with tr
- [Shell command] Count characters with wc
- [Shell command] Create a password-protected ZIP file with zip
- [Shell command] Create a temporary file with mktemp
- [Shell command] Create missing parent directories with mkdir -p
- [Shell command] Encode and decode Base64 text
- [Shell command] Expand environment variables with envsubst
- [Shell command] Expand only specified environment variables with envsubst
- [Shell command] Extract a column from simple CSV with cut
- [Shell command] Find files by name with find
- [Shell command] Get the current Unix timestamp with date
- [Shell command] Join corresponding lines with paste
- [Shell command] Prepend text to a file's contents with echo and cat
- [Shell command] Print line breaks with echo -e in Bash
- [Shell command] Read search patterns from a file with grep
- [Shell command] Remove double quotes from a string
- [Shell command] Remove the first N characters from every line
- [Shell command] Send a POST request with curl
- [Shell command] Show a directory's total disk usage
- [Shell command] Show response headers with curl
- [Shell command] Skip the xargs command when there is no input
- [Shell command] Upload a file with curl -F
- [Shell command] Write command output to both a file and standard output
- [Shell] Combine the standard output of multiple commands
- [Slack] Add a line break to a /remind command
- [Slack] List reminders in a channel
- [sort] Reverse the sort order
- [sort] Sort lines and keep only one of each
- [sort] Sort lines numerically with sort -n
- [sort] Sort rows using a particular column
- [sort] Sort version-like strings with sort -V
- [split] Split a file into chunks of N lines
- [SSH] Specify a private key file
- [tail] Print only the last line
- [tar] Extract a gzip-compressed tar archive
- [tar] List the files in an archive without extracting them
- [Terraform] Print output values as JSON
- [Terraform] Skip the yes prompt when running terraform apply
- [Todoist] List tasks with curl and the legacy REST API
- [TypeScript] Fix 'Cannot find name console' for console.log
- [TypeScript] Remove a property from a type with Omit
- [TypeScript] Run a TypeScript file with ts-node
- [TypeScript] Treat an empty object as an interface type
- [Ubuntu] Check the OS version from the command line
- [Ubuntu] Inspect a font file's family and style with fc-query
- [Ubuntu] Install a font for the current user
- [Ubuntu] Install a local .deb package from the command line
- [Ubuntu] List installed fonts
- [Ubuntu] See which font matches a family name with fc-match
- [Ubuntu] Use Caps Lock as a Control key
- [Ubuntu] Use Vim as the default editor
- [uniq] Count repeated lines with uniq -c
- [vim-go] Add Go imports automatically on save
- [Vim] Search without matching case
- [Vim] Show tabs and line endings with :set list
- [VS Code] Enable word wrap by default
- [VS Code] Install an extension from the command line
- [VS Code] List installed extensions from the command line
- [VS Code] Make the code command available in fish on macOS
- [VS Code] Open a diff from the command line
- [wget] Choose the output file name
- [xargs] Insert each input line into an argument
- [xargs] Read NUL-delimited filenames with xargs -0
- [xargs] Run commands in parallel
- [zip] Create a ZIP archive from a directory
[jq] Sort an array of objects by a property
Created on November 30, 2026
Use sort_by to sort objects by a property. The example sorts by age in ascending order.
echo '[{"name":"Taro","age":30},{"name":"Jiro","age":20},{"name":"Saburo","age":25}]' | jq 'sort_by(.age)'
[
{
"name": "Jiro",
"age": 20
},
{
"name": "Saburo",
"age": 25
},
{
"name": "Taro",
"age": 30
}
]
For descending order, use sort_by(.age) | reverse. If the property contains strings, jq sorts by those string values.