FIND YOUR NEXT FEW LINES

Results for “Bash Scripts”

Small, practical examples. Search by task or narrow things down below.

379 snippets foundClear filters
GitCommit history & revision selection

Count commits reachable from a revision

Git: rev-list --count counts reachable commits without printing commit identifiers.

Git✓ Tested
GitBranches & ancestry

Count commits unique to each of two branches

Git: The symmetric difference with left-right separates commits reachable from only one side.

Git✓ Tested
Linux CommandsText processing

Count lines in a file

Count newline characters in a text file, printing only the count without the filename.

lines✓ Tested
Linux CommandsSearching text

Count matching lines

Linux Commands: Use grep -c to count matching lines rather than individual occurrences.

Linux Commands✓ Tested
Linux CommandsGetting Started

Count newline-terminated records

Linux Commands: Count newline-terminated records using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Count repeated lines after sorting

Linux Commands: Group identical lines before uniq -c, then normalize its leading padding.

Linux Commands✓ Tested
Linux CommandsStreams & byte tools

Count whitespace-separated words

Linux Commands: Use wc -w with standard input to omit the filename column.

Linux Commands✓ Tested
GitStashing selected work

Create a branch at the original base of a stash

Git: stash branch checks out the stash’s base and reapplies the saved work there.

Git✓ Tested
GitBranches & ancestry

Create a branch from a known release tag

Git: A named starting revision makes the branch’s initial commit explicit.

Git✓ Tested
GitGetting Started

Create a branch without switching to it

Git: Create a branch without switching to it inside the disposable repository created by the input setup.

Git✓ Tested
Linux CommandsArchives & checksums

Create a compressed tar archive

Bundle a directory into a gzip-compressed tar archive, preserving the directory structure.

tar✓ Tested
Linux CommandsFiles & folders

Create a directory tree

Create a directory and its missing parent directories. The -p option also succeeds when the directories already exist.

directory✓ Tested