instruction
stringlengths
17
36
input
stringclasses
1 value
output
stringlengths
101
1.77k
What is chgrp command
# chgrp > Change group ownership of files and directories. More information: > https://www.gnu.org/software/coreutils/chgrp. * Change the owner group of a file/directory: `chgrp {{group}} {{path/to/file_or_directory}}` * Recursively change the owner group of a directory and its contents: `chgrp -R {{group}} {{path/to/directory}}` * Change the owner group of a symbolic link: `chgrp -h {{group}} {{path/to/symlink}}` * Change the owner group of a file/directory to match a reference file: `chgrp --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`
What is more command
# more > Open a file for interactive reading, allowing scrolling and search. More > information: https://manned.org/more. * Open a file: `more {{path/to/file}}` * Open a file displaying from a specific line: `more +{{line_number}} {{path/to/file}}` * Display help: `more --help` * Go to the next page: `<Space>` * Search for a string (press `n` to go to the next match): `/{{something}}` * Exit: `q` * Display help about interactive commands: `h`
What is git-hash-object command
# git hash-object > Computes the unique hash key of content and optionally creates an object > with specified type. More information: https://git-scm.com/docs/git-hash- > object. * Compute the object ID without storing it: `git hash-object {{path/to/file}}` * Compute the object ID and store it in the Git database: `git hash-object -w {{path/to/file}}` * Compute the object ID specifying the object type: `git hash-object -t {{blob|commit|tag|tree}} {{path/to/file}}` * Compute the object ID from `stdin`: `cat {{path/to/file}} | git hash-object --stdin`
What is id command
# id > Display current user and group identity. More information: > https://www.gnu.org/software/coreutils/id. * Display current user's ID (UID), group ID (GID) and groups to which they belong: `id` * Display the current user identity as a number: `id -u` * Display the current group identity as a number: `id -g` * Display an arbitrary user's ID (UID), group ID (GID) and groups to which they belong: `id {{username}}`
What is nl command
# nl > A utility for numbering lines, either from a file, or from `stdin`. More > information: https://www.gnu.org/software/coreutils/nl. * Number non-blank lines in a file: `nl {{path/to/file}}` * Read from `stdout`: `cat {{path/to/file}} | nl {{options}} -` * Number only the lines with printable text: `nl -t {{path/to/file}}` * Number all lines including blank lines: `nl -b a {{path/to/file}}` * Number only the body lines that match a basic regular expression (BRE) pattern: `nl -b p'FooBar[0-9]' {{path/to/file}}`
What is git-check-ignore command
# git check-ignore > Analyze and debug Git ignore/exclude (".gitignore") files. More information: > https://git-scm.com/docs/git-check-ignore. * Check whether a file or directory is ignored: `git check-ignore {{path/to/file_or_directory}}` * Check whether multiple files or directories are ignored: `git check-ignore {{path/to/file}} {{path/to/directory}}` * Use pathnames, one per line, from `stdin`: `git check-ignore --stdin < {{path/to/file_list}}` * Do not check the index (used to debug why paths were tracked and not ignored): `git check-ignore --no-index {{path/to/files_or_directories}}` * Include details about the matching pattern for each path: `git check-ignore --verbose {{path/to/files_or_directories}}`
What is tcpdump command
# tcpdump > Dump traffic on a network. More information: https://www.tcpdump.org. * List available network interfaces: `tcpdump -D` * Capture the traffic of a specific interface: `tcpdump -i {{eth0}}` * Capture all TCP traffic showing contents (ASCII) in console: `tcpdump -A tcp` * Capture the traffic from or to a host: `tcpdump host {{www.example.com}}` * Capture the traffic from a specific interface, source, destination and destination port: `tcpdump -i {{eth0}} src {{192.168.1.1}} and dst {{192.168.1.2}} and dst port {{80}}` * Capture the traffic of a network: `tcpdump net {{192.168.1.0/24}}` * Capture all traffic except traffic over port 22 and save to a dump file: `tcpdump -w {{dumpfile.pcap}} port not {{22}}` * Read from a given dump file: `tcpdump -r {{dumpfile.pcap}}`
What is users command
# users > Display a list of logged in users. See also: `useradd`, `userdel`, > `usermod`. More information: https://www.gnu.org/software/coreutils/users. * Print logged in usernames: `users` * Print logged in usernames according to a given file: `users {{/var/log/wmtp}}`
What is git-rev-list command
# git rev-list > List revisions (commits) in reverse chronological order. More information: > https://git-scm.com/docs/git-rev-list. * List all commits on the current branch: `git rev-list {{HEAD}}` * Print the latest commit that changed (add/edit/remove) a specific file on the current branch: `git rev-list -n 1 HEAD -- {{path/to/file}}` * List commits more recent than a specific date, on a specific branch: `git rev-list --since={{'2019-12-01 00:00:00'}} {{branch_name}}` * List all merge commits on a specific commit: `git rev-list --merges {{commit}}` * Print the number of commits since a specific tag: `git rev-list {{tag_name}}..HEAD --count`
What is lpr command
# lpr > CUPS tool for printing files. See also: `lpstat` and `lpadmin`. More > information: https://www.cups.org/doc/man-lpr.html. * Print a file to the default printer: `lpr {{path/to/file}}` * Print 2 copies: `lpr -# {{2}} {{path/to/file}}` * Print to a named printer: `lpr -P {{printer}} {{path/to/file}}` * Print either a single page (e.g. 2) or a range of pages (e.g. 2–16): `lpr -o page-ranges={{2|2-16}} {{path/to/file}}` * Print double-sided either in portrait (long) or in landscape (short): `lpr -o sides={{two-sided-long-edge|two-sided-short-edge}} {{path/to/file}}` * Set page size (more options may be available depending on setup): `lpr -o media={{a4|letter|legal}} {{path/to/file}}` * Print multiple pages per sheet: `lpr -o number-up={{2|4|6|9|16}} {{path/to/file}}`
What is lp command
# lp > Print files. More information: https://manned.org/lp. * Print the output of a command to the default printer (see `lpstat` command): `echo "test" | lp` * Print a file to the default printer: `lp {{path/to/filename}}` * Print a file to a named printer (see `lpstat` command): `lp -d {{printer_name}} {{path/to/filename}}` * Print N copies of file to default printer (replace N with desired number of copies): `lp -n {{N}} {{path/to/filename}}` * Print only certain pages to the default printer (print pages 1, 3-5, and 16): `lp -P 1,3-5,16 {{path/to/filename}}` * Resume printing a job: `lp -i {{job_id}} -H resume`
What is uptime command
# uptime > Tell how long the system has been running and other information. More > information: https://ss64.com/osx/uptime.html. * Print current time, uptime, number of logged-in users and other information: `uptime`
What is git-count-objects command
# git count-objects > Count the number of unpacked objects and their disk consumption. More > information: https://git-scm.com/docs/git-count-objects. * Count all objects and display the total disk usage: `git count-objects` * Display a count of all objects and their total disk usage, displaying sizes in human-readable units: `git count-objects --human-readable` * Display more verbose information: `git count-objects --verbose` * Display more verbose information, displaying sizes in human-readable units: `git count-objects --human-readable --verbose`
What is git-shortlog command
# git shortlog > Summarizes the `git log` output. More information: https://git- > scm.com/docs/git-shortlog. * View a summary of all the commits made, grouped alphabetically by author name: `git shortlog` * View a summary of all the commits made, sorted by the number of commits made: `git shortlog -n` * View a summary of all the commits made, grouped by the committer identities (name and email): `git shortlog -c` * View a summary of the last 5 commits (i.e. specify a revision range): `git shortlog HEAD~{{5}}..HEAD` * View all users, emails and the number of commits in the current branch: `git shortlog -sne` * View all users, emails and the number of commits in all branches: `git shortlog -sne --all`
What is pv command
# pv > Monitor the progress of data through a pipe. More information: > https://manned.org/pv. * Print the contents of the file and display a progress bar: `pv {{path/to/file}}` * Measure the speed and amount of data flow between pipes (`--size` is optional): `command1 | pv --size {{expected_amount_of_data_for_eta}} | command2` * Filter a file, see both progress and amount of output data: `pv -cN in {{big_text_file}} | grep {{pattern}} | pv -cN out > {{filtered_file}}` * Attach to an already running process and see its file reading progress: `pv -d {{PID}}` * Read an erroneous file, skip errors as `dd conv=sync,noerror` would: `pv -EE {{path/to/faulty_media}} > image.img` * Stop reading after reading specified amount of data, rate limit to 1K/s: `pv -L 1K --stop-at --size {{maximum_file_size_to_be_read}}`
What is nl command
# nl > A utility for numbering lines, either from a file, or from `stdin`. More > information: https://www.gnu.org/software/coreutils/nl. * Number non-blank lines in a file: `nl {{path/to/file}}` * Read from `stdout`: `cat {{path/to/file}} | nl {{options}} -` * Number only the lines with printable text: `nl -t {{path/to/file}}` * Number all lines including blank lines: `nl -b a {{path/to/file}}` * Number only the body lines that match a basic regular expression (BRE) pattern: `nl -b p'FooBar[0-9]' {{path/to/file}}`
What is git-svn command
# git svn > Bidirectional operation between a Subversion repository and Git. More > information: https://git-scm.com/docs/git-svn. * Clone an SVN repository: `git svn clone {{https://example.com/subversion_repo}} {{local_dir}}` * Clone an SVN repository starting at a given revision number: `git svn clone -r{{1234}}:HEAD {{https://svn.example.net/subversion/repo}} {{local_dir}}` * Update local clone from the remote SVN repository: `git svn rebase` * Fetch updates from the remote SVN repository without changing the Git HEAD: `git svn fetch` * Commit back to the SVN repository: `git svn dcommit`
What is grep command
# grep > Find patterns in files using regular expressions. More information: > https://www.gnu.org/software/grep/manual/grep.html. * Search for a pattern within a file: `grep "{{search_pattern}}" {{path/to/file}}` * Search for an exact string (disables regular expressions): `grep --fixed-strings "{{exact_string}}" {{path/to/file}}` * Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files: `grep --recursive --line-number --binary-files={{without-match}} "{{search_pattern}}" {{path/to/directory}}` * Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode: `grep --extended-regexp --ignore-case "{{search_pattern}}" {{path/to/file}}` * Print 3 lines of context around, before, or after each match: `grep --{{context|before-context|after-context}}={{3}} "{{search_pattern}}" {{path/to/file}}` * Print file name and line number for each match with color output: `grep --with-filename --line-number --color=always "{{search_pattern}}" {{path/to/file}}` * Search for lines matching a pattern, printing only the matched text: `grep --only-matching "{{search_pattern}}" {{path/to/file}}` * Search `stdin` for lines that do not match a pattern: `cat {{path/to/file}} | grep --invert-match "{{search_pattern}}"`
What is systemd-run command
# systemd-run > Run programs in transient scope units, service units, or path-, socket-, or > timer-triggered service units. More information: > https://www.freedesktop.org/software/systemd/man/systemd-run.html. * Start a transient service: `sudo systemd-run {{command}} {{argument1 argument2 ...}}` * Start a transient service under the service manager of the current user (no privileges): `systemd-run --user {{command}} {{argument1 argument2 ...}}` * Start a transient service with a custom unit name and description: `sudo systemd-run --unit={{name}} --description={{string}} {{command}} {{argument1 argument2 ...}}` * Start a transient service that does not get cleaned up after it terminates with a custom environment variable: `sudo systemd-run --remain-after-exit --set-env={{name}}={{value}} {{command}} {{argument1 argument2 ...}}` * Start a transient timer that periodically runs its transient service (see `man systemd.time` for calendar event format): `sudo systemd-run --on-calendar={{calendar_event}} {{command}} {{argument1 argument2 ...}}` * Share the terminal with the program (allowing interactive input/output) and make sure the execution details remain after the program exits: `systemd-run --remain-after-exit --pty {{command}}` * Set properties (e.g. CPUQuota, MemoryMax) of the process and wait until it exits: `systemd-run --property MemoryMax={{memory_in_bytes}} --property CPUQuota={{percentage_of_CPU_time}}% --wait {{command}}` * Use the program in a shell pipeline: `{{command1}} | systemd-run --pipe {{command2}} | {{command3}}`
What is tput command
# tput > View and modify terminal settings and capabilities. More information: > https://manned.org/tput. * Move the cursor to a screen location: `tput cup {{row}} {{column}}` * Set foreground (af) or background (ab) color: `tput {{setaf|setab}} {{ansi_color_code}}` * Show number of columns, lines, or colors: `tput {{cols|lines|colors}}` * Ring the terminal bell: `tput bel` * Reset all terminal attributes: `tput sgr0` * Enable or disable word wrap: `tput {{smam|rmam}}`
What is link command
# link > Create a hard link to an existing file. For more options, see the `ln` > command. More information: https://www.gnu.org/software/coreutils/link. * Create a hard link from a new file to an existing file: `link {{path/to/existing_file}} {{path/to/new_file}}`
What is logname command
# logname > Shows the user's login name. More information: > https://www.gnu.org/software/coreutils/logname. * Display the currently logged in user's name: `logname`
What is iconv command
# iconv > Converts text from one encoding to another. More information: > https://manned.org/iconv. * Convert file to a specific encoding, and print to `stdout`: `iconv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}` * Convert file to the current locale's encoding, and output to a file: `iconv -f {{from_encoding}} {{input_file}} > {{output_file}}` * List supported encodings: `iconv -l`
What is paste command
# paste > Merge lines of files. More information: > https://www.gnu.org/software/coreutils/paste. * Join all the lines into a single line, using TAB as delimiter: `paste -s {{path/to/file}}` * Join all the lines into a single line, using the specified delimiter: `paste -s -d {{delimiter}} {{path/to/file}}` * Merge two files side by side, each in its column, using TAB as delimiter: `paste {{file1}} {{file2}}` * Merge two files side by side, each in its column, using the specified delimiter: `paste -d {{delimiter}} {{file1}} {{file2}}` * Merge two files, with lines added alternatively: `paste -d '\n' {{file1}} {{file2}}`
What is ls command
# ls > List directory contents. More information: > https://www.gnu.org/software/coreutils/ls. * List files one per line: `ls -1` * List all files, including hidden files: `ls -a` * List all files, with trailing `/` added to directory names: `ls -F` * Long format list (permissions, ownership, size, and modification date) of all files: `ls -la` * Long format list with size displayed using human-readable units (KiB, MiB, GiB): `ls -lh` * Long format list sorted by size (descending): `ls -lS` * Long format list of all files, sorted by modification date (oldest first): `ls -ltr` * Only list directories: `ls -d */`
What is mktemp command
# mktemp > Create a temporary file or directory. More information: > https://ss64.com/osx/mktemp.html. * Create an empty temporary file and print the absolute path to it: `mktemp` * Create an empty temporary file with a given suffix and print the absolute path to file: `mktemp --suffix "{{.ext}}"` * Create a temporary directory and print the absolute path to it: `mktemp -d`
What is git-range-diff command
# git range-diff > Compare two commit ranges (e.g. two versions of a branch). More information: > https://git-scm.com/docs/git-range-diff. * Diff the changes of two individual commits: `git range-diff {{commit_1}}^! {{commit_2}}^!` * Diff the changes of ours and theirs from their common ancestor, e.g. after an interactive rebase: `git range-diff {{theirs}}...{{ours}}` * Diff the changes of two commit ranges, e.g. to check whether conflicts have been resolved appropriately when rebasing commits from `base1` to `base2`: `git range-diff {{base1}}..{{rev1}} {{base2}}..{{rev2}}`
What is quilt command
# quilt > Tool to manage a series of patches. More information: > https://savannah.nongnu.org/projects/quilt. * Import an existing patch from a file: `quilt import {{path/to/filename.patch}}` * Create a new patch: `quilt new {{filename.patch}}` * Add a file to the current patch: `quilt add {{path/to/file}}` * After editing the file, refresh the current patch with the changes: `quilt refresh` * Apply all the patches in the series file: `quilt push -a` * Remove all applied patches: `quilt pop -a`
What is nohup command
# nohup > Allows for a process to live when the terminal gets killed. More > information: https://www.gnu.org/software/coreutils/nohup. * Run a process that can live beyond the terminal: `nohup {{command}} {{argument1 argument2 ...}}` * Launch `nohup` in background mode: `nohup {{command}} {{argument1 argument2 ...}} &` * Run a shell script that can live beyond the terminal: `nohup {{path/to/script.sh}} &` * Run a process and write the output to a specific file: `nohup {{command}} {{argument1 argument2 ...}} > {{path/to/output_file}} &`
What is expand command
# expand > Convert tabs to spaces. More information: > https://www.gnu.org/software/coreutils/expand. * Convert tabs in each file to spaces, writing to `stdout`: `expand {{path/to/file}}` * Convert tabs to spaces, reading from `stdin`: `expand` * Do not convert tabs after non blanks: `expand -i {{path/to/file}}` * Have tabs a certain number of characters apart, not 8: `expand -t={{number}} {{path/to/file}}` * Use a comma separated list of explicit tab positions: `expand -t={{1,4,6}}`
What is strace command
# strace > Troubleshooting tool for tracing system calls. More information: > https://manned.org/strace. * Start tracing a specific process by its PID: `strace -p {{pid}}` * Trace a process and filter output by system call: `strace -p {{pid}} -e {{system_call_name}}` * Count time, calls, and errors for each system call and report a summary on program exit: `strace -p {{pid}} -c` * Show the time spent in every system call: `strace -p {{pid}} -T` * Start tracing a program by executing it: `strace {{program}}` * Start tracing file operations of a program: `strace -e trace=file {{program}}`
What is cmp command
# cmp > Compare two files byte by byte. More information: > https://www.gnu.org/software/diffutils/manual/html_node/Invoking-cmp.html. * Output char and line number of the first difference between two files: `cmp {{path/to/file1}} {{path/to/file2}}` * Output info of the first difference: char, line number, bytes, and values: `cmp --print-bytes {{path/to/file1}} {{path/to/file2}}` * Output the byte numbers and values of every difference: `cmp --verbose {{path/to/file1}} {{path/to/file2}}` * Compare files but output nothing, yield only the exit status: `cmp --quiet {{path/to/file1}} {{path/to/file2}}`
What is chmod command
# chmod > Change the access permissions of a file or directory. More information: > https://www.gnu.org/software/coreutils/chmod. * Give the [u]ser who owns a file the right to e[x]ecute it: `chmod u+x {{path/to/file}}` * Give the [u]ser rights to [r]ead and [w]rite to a file/directory: `chmod u+rw {{path/to/file_or_directory}}` * Remove e[x]ecutable rights from the [g]roup: `chmod g-x {{path/to/file}}` * Give [a]ll users rights to [r]ead and e[x]ecute: `chmod a+rx {{path/to/file}}` * Give [o]thers (not in the file owner's group) the same rights as the [g]roup: `chmod o=g {{path/to/file}}` * Remove all rights from [o]thers: `chmod o= {{path/to/file}}` * Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite: `chmod -R g+w,o+w {{path/to/directory}}` * Recursively give [a]ll users [r]ead permissions to files and e[X]ecute permissions to sub-directories within a directory: `chmod -R a+rX {{path/to/directory}}`
What is chsh command
# chsh > Change user's login shell. More information: https://manned.org/chsh. * Set a specific login shell for the current user interactively: `chsh` * Set a specific login [s]hell for the current user: `chsh -s {{path/to/shell}}` * Set a login [s]hell for a specific user: `chsh -s {{path/to/shell}} {{username}}` * [l]ist available shells: `chsh -l`
What is coredumpctl command
# coredumpctl > Retrieve and process saved core dumps and metadata. More information: > https://www.freedesktop.org/software/systemd/man/coredumpctl.html. * List all captured core dumps: `coredumpctl list` * List captured core dumps for a program: `coredumpctl list {{program}}` * Show information about the core dumps matching a program with `PID`: `coredumpctl info {{PID}}` * Invoke debugger using the last core dump of a program: `coredumpctl debug {{program}}` * Extract the last core dump of a program to a file: `coredumpctl --output={{path/to/file}} dump {{program}}`
What is git-check-mailmap command
# git check-mailmap > Show canonical names and email addresses of contacts. More information: > https://git-scm.com/docs/git-check-mailmap. * Look up the canonical name associated with an email address: `git check-mailmap "<{{[email protected]}}>"`
What is top command
# top > Display dynamic real-time information about running processes. More > information: https://ss64.com/osx/top.html. * Start `top`, all options are available in the interface: `top` * Start `top` sorting processes by internal memory size (default order - process ID): `top -o mem` * Start `top` sorting processes first by CPU, then by running time: `top -o cpu -O time` * Start `top` displaying only processes owned by given user: `top -user {{user_name}}` * Get help about interactive commands: `?`
What is unshare command
# unshare > Execute a command in new user-defined namespaces. More information: > https://www.kernel.org/doc/html/latest/userspace-api/unshare.html. * Execute a command without sharing access to connected networks: `unshare --net {{command}} {{command_arguments}}` * Execute a command as a child process without sharing mounts, processes, or networks: `unshare --mount --pid --net --fork {{command}} {{command_arguments}}`
What is git-switch command
# git switch > Switch between Git branches. Requires Git version 2.23+. See also `git > checkout`. More information: https://git-scm.com/docs/git-switch. * Switch to an existing branch: `git switch {{branch_name}}` * Create a new branch and switch to it: `git switch --create {{branch_name}}` * Create a new branch based on an existing commit and switch to it: `git switch --create {{branch_name}} {{commit}}` * Switch to the previous branch: `git switch -` * Switch to a branch and update all submodules to match: `git switch --recurse-submodules {{branch_name}}` * Switch to a branch and automatically merge the current branch and any uncommitted changes into it: `git switch --merge {{branch_name}}`
What is dpkg command
# dpkg > Debian package manager. Some subcommands such as `dpkg deb` have their own > usage documentation. For equivalent commands in other package managers, see > https://wiki.archlinux.org/title/Pacman/Rosetta. More information: > https://manpages.debian.org/latest/dpkg/dpkg.html. * Install a package: `dpkg -i {{path/to/file.deb}}` * Remove a package: `dpkg -r {{package}}` * List installed packages: `dpkg -l {{pattern}}` * List a package's contents: `dpkg -L {{package}}` * List contents of a local package file: `dpkg -c {{path/to/file.deb}}` * Find out which package owns a file: `dpkg -S {{path/to/file}}`
What is m4 command
# m4 > Macro processor. More information: https://www.gnu.org/software/m4. * Process macros in a file: `m4 {{path/to/file}}` * Define a macro before processing files: `m4 -D{{macro_name}}={{macro_value}} {{path/to/file}}`
What is git-check-ref-format command
# git check-ref-format > Checks if a given refname is acceptable, and exits with a non-zero status if > it is not. More information: https://git-scm.com/docs/git-check-ref-format. * Check the format of the specified refname: `git check-ref-format {{refs/head/refname}}` * Print the name of the last branch checked out: `git check-ref-format --branch @{-1}` * Normalize a refname: `git check-ref-format --normalize {{refs/head/refname}}`
What is date command
# date > Set or display the system date. More information: > https://ss64.com/osx/date.html. * Display the current date using the default locale's format: `date +%c` * Display the current date in UTC and ISO 8601 format: `date -u +%Y-%m-%dT%H:%M:%SZ` * Display the current date as a Unix timestamp (seconds since the Unix epoch): `date +%s` * Display a specific date (represented as a Unix timestamp) using the default format: `date -r 1473305798`
What is git-rebase command
# git rebase > Reapply commits from one branch on top of another branch. Commonly used to > "move" an entire branch to another base, creating copies of the commits in > the new location. More information: https://git-scm.com/docs/git-rebase. * Rebase the current branch on top of another specified branch: `git rebase {{new_base_branch}}` * Start an interactive rebase, which allows the commits to be reordered, omitted, combined or modified: `git rebase -i {{target_base_branch_or_commit_hash}}` * Continue a rebase that was interrupted by a merge failure, after editing conflicting files: `git rebase --continue` * Continue a rebase that was paused due to merge conflicts, by skipping the conflicted commit: `git rebase --skip` * Abort a rebase in progress (e.g. if it is interrupted by a merge conflict): `git rebase --abort` * Move part of the current branch onto a new base, providing the old base to start from: `git rebase --onto {{new_base}} {{old_base}}` * Reapply the last 5 commits in-place, stopping to allow them to be reordered, omitted, combined or modified: `git rebase -i {{HEAD~5}}` * Auto-resolve any conflicts by favoring the working branch version (`theirs` keyword has reversed meaning in this case): `git rebase -X theirs {{branch_name}}`
What is git-commit-graph command
# git commit-graph > Write and verify Git commit-graph files. More information: https://git- > scm.com/docs/git-commit-graph. * Write a commit-graph file for the packed commits in the repository's local `.git` directory: `git commit-graph write` * Write a commit-graph file containing all reachable commits: `git show-ref --hash | git commit-graph write --stdin-commits` * Write a commit-graph file containing all commits in the current commit-graph file along with those reachable from `HEAD`: `git rev-parse {{HEAD}} | git commit-graph write --stdin-commits --append`
What is chroot command
# chroot > Run command or interactive shell with special root directory. More > information: https://www.gnu.org/software/coreutils/chroot. * Run command as new root directory: `chroot {{path/to/new/root}} {{command}}` * Specify user and group (ID or name) to use: `chroot --userspec={{user:group}}`
What is mesg command
# mesg > Check or set a terminal's ability to receive messages from other users, > usually from the write command. See also `write`. More information: > https://manned.org/mesg. * Check terminal's openness to write messages: `mesg` * Disable receiving messages from the write command: `mesg n` * Enable receiving messages from the write command: `mesg y`
What is grep command
# grep > Find patterns in files using regular expressions. More information: > https://www.gnu.org/software/grep/manual/grep.html. * Search for a pattern within a file: `grep "{{search_pattern}}" {{path/to/file}}` * Search for an exact string (disables regular expressions): `grep --fixed-strings "{{exact_string}}" {{path/to/file}}` * Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files: `grep --recursive --line-number --binary-files={{without-match}} "{{search_pattern}}" {{path/to/directory}}` * Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode: `grep --extended-regexp --ignore-case "{{search_pattern}}" {{path/to/file}}` * Print 3 lines of context around, before, or after each match: `grep --{{context|before-context|after-context}}={{3}} "{{search_pattern}}" {{path/to/file}}` * Print file name and line number for each match with color output: `grep --with-filename --line-number --color=always "{{search_pattern}}" {{path/to/file}}` * Search for lines matching a pattern, printing only the matched text: `grep --only-matching "{{search_pattern}}" {{path/to/file}}` * Search `stdin` for lines that do not match a pattern: `cat {{path/to/file}} | grep --invert-match "{{search_pattern}}"`
What is less command
# less > Open a file for interactive reading, allowing scrolling and search. More > information: https://greenwoodsoftware.com/less/. * Open a file: `less {{source_file}}` * Page down/up: `<Space> (down), b (up)` * Go to end/start of file: `G (end), g (start)` * Forward search for a string (press `n`/`N` to go to next/previous match): `/{{something}}` * Backward search for a string (press `n`/`N` to go to next/previous match): `?{{something}}` * Follow the output of the currently opened file: `F` * Open the current file in an editor: `v` * Exit: `q`
What is git-add command
# git add > Adds changed files to the index. More information: https://git- > scm.com/docs/git-add. * Add a file to the index: `git add {{path/to/file}}` * Add all files (tracked and untracked): `git add -A` * Only add already tracked files: `git add -u` * Also add ignored files: `git add -f` * Interactively stage parts of files: `git add -p` * Interactively stage parts of a given file: `git add -p {{path/to/file}}` * Interactively stage a file: `git add -i`
What is indent command
# indent > Change the appearance of a C/C++ program by inserting or deleting > whitespace. More information: > https://www.freebsd.org/cgi/man.cgi?query=indent. * Format C/C++ source according to the Berkeley style: `indent {{path/to/source_file.c}} {{path/to/indented_file.c}} -nbad -nbap -bc -br -c33 -cd33 -cdb -ce -ci4 -cli0 -di16 -fc1 -fcb -i4 -ip -l75 -lp -npcs -nprs -psl -sc -nsob -ts8` * Format C/C++ source according to the style of Kernighan & Ritchie (K&R): `indent {{path/to/source_file.c}} {{path/to/indented_file.c}} -nbad -bap -nbc -br -c33 -cd33 -ncdb -ce -ci4 -cli0 -cs -d0 -di1 -nfc1 -nfcb -i4 -nip -l75 -lp -npcs -nprs -npsl -nsc -nsob`
What is stty command
# stty > Set options for a terminal device interface. More information: > https://www.gnu.org/software/coreutils/stty. * Display all settings for the current terminal: `stty --all` * Set the number of rows or columns: `stty {{rows|cols}} {{count}}` * Get the actual transfer speed of a device: `stty --file {{path/to/device_file}} speed` * Reset all modes to reasonable values for the current terminal: `stty sane`
What is git-column command
# git column > Display data in columns. More information: https://git-scm.com/docs/git- > column. * Format `stdin` as multiple columns: `ls | git column --mode={{column}}` * Format `stdin` as multiple columns with a maximum width of `100`: `ls | git column --mode=column --width={{100}}` * Format `stdin` as multiple columns with a maximum padding of `30`: `ls | git column --mode=column --padding={{30}}`
What is who command
# who > Display who is logged in and related data (processes, boot time). More > information: https://www.gnu.org/software/coreutils/who. * Display the username, line, and time of all currently logged-in sessions: `who` * Display information only for the current terminal session: `who am i` * Display all available information: `who -a` * Display all available information with table headers: `who -a -H`
What is git-notes command
# git notes > Add or inspect object notes. More information: https://git-scm.com/docs/git- > notes. * List all notes and the objects they are attached to: `git notes list` * List all notes attached to a given object (defaults to HEAD): `git notes list [{{object}}]` * Show the notes attached to a given object (defaults to HEAD): `git notes show [{{object}}]` * Append a note to a specified object (opens the default text editor): `git notes append {{object}}` * Append a note to a specified object, specifying the message: `git notes append --message="{{message_text}}"` * Edit an existing note (defaults to HEAD): `git notes edit [{{object}}]` * Copy a note from one object to another: `git notes copy {{source_object}} {{target_object}}` * Remove all the notes added to a specified object: `git notes remove {{object}}`
What is git-mv command
# git mv > Move or rename files and update the Git index. More information: > https://git-scm.com/docs/git-mv. * Move a file inside the repo and add the movement to the next commit: `git mv {{path/to/file}} {{new/path/to/file}}` * Rename a file or directory and add the renaming to the next commit: `git mv {{path/to/file_or_directory}} {{path/to/destination}}` * Overwrite the file or directory in the target path if it exists: `git mv --force {{path/to/file_or_directory}} {{path/to/destination}}`
What is strip command
# strip > Discard symbols from executables or object files. More information: > https://manned.org/strip. * Replace the input file with its stripped version: `strip {{path/to/file}}` * Strip symbols from a file, saving the output to a specific file: `strip {{path/to/input_file}} -o {{path/to/output_file}}` * Strip debug symbols only: `strip --strip-debug {{path/to/file.o}}`
What is bash command
# bash > Bourne-Again SHell, an `sh`-compatible command-line interpreter. See also: > `zsh`, `histexpand` (history expansion). More information: > https://gnu.org/software/bash/. * Start an interactive shell session: `bash` * Start an interactive shell session without loading startup configs: `bash --norc` * Execute specific [c]ommands: `bash -c "{{echo 'bash is executed'}}"` * Execute a specific script: `bash {{path/to/script.sh}}` * Execute a specific script while printing each command before executing it: `bash -x {{path/to/script.sh}}` * Execute a specific script and stop at the first [e]rror: `bash -e {{path/to/script.sh}}` * Execute specific commands from `stdin`: `{{echo "echo 'bash is executed'"}} | bash` * Start a [r]estricted shell session: `bash -r`
What is exit command
# exit > Exit the shell. More information: https://manned.org/exit. * Exit the shell with the exit code of the last command executed: `exit` * Exit the shell with the specified exit code: `exit {{exit_code}}`
What is uniq command
# uniq > Output the unique lines from the given input or file. Since it does not > detect repeated lines unless they are adjacent, we need to sort them first. > More information: https://www.gnu.org/software/coreutils/uniq. * Display each line once: `sort {{path/to/file}} | uniq` * Display only unique lines: `sort {{path/to/file}} | uniq -u` * Display only duplicate lines: `sort {{path/to/file}} | uniq -d` * Display number of occurrences of each line along with that line: `sort {{path/to/file}} | uniq -c` * Display number of occurrences of each line, sorted by the most frequent: `sort {{path/to/file}} | uniq -c | sort -nr`
What is git-mailinfo command
# git mailinfo > Extract patch and authorship information from a single email message. More > information: https://git-scm.com/docs/git-mailinfo. * Extract the patch and author data from an email message: `git mailinfo {{message|patch}}` * Extract but remove leading and trailing whitespace: `git mailinfo -k {{message|patch}}` * Remove everything from the body before a scissors line (e.g. "-->* --") and retrieve the message or patch: `git mailinfo --scissors {{message|patch}}`
What is git-annotate command
# git annotate > Show commit hash and last author on each line of a file. See `git blame`, > which is preferred over `git annotate`. `git annotate` is provided for those > familiar with other version control systems. More information: https://git- > scm.com/docs/git-annotate. * Print a file with the author name and commit hash prepended to each line: `git annotate {{path/to/file}}` * Print a file with the author email and commit hash prepended to each line: `git annotate -e {{path/to/file}}` * Print only rows that match a regular expression: `git annotate -L :{{regexp}} {{path/to/file}}`
What is pstree command
# pstree > A convenient tool to show running processes as a tree. More information: > https://manned.org/pstree. * Display a tree of processes: `pstree` * Display a tree of processes with PIDs: `pstree -p` * Display all process trees rooted at processes owned by specified user: `pstree {{user}}`
What is ac command
# ac > Print statistics on how long users have been connected. More information: > https://man.openbsd.org/ac. * Print how long the current user has been connected in hours: `ac` * Print how long users have been connected in hours: `ac -p` * Print how long a particular user has been connected in hours: `ac -p {{username}}` * Print how long a particular user has been connected in hours per day (with total): `ac -dp {{username}}`
What is sha1sum command
# sha1sum > Calculate SHA1 cryptographic checksums. More information: > https://www.gnu.org/software/coreutils/sha1sum. * Calculate the SHA1 checksum for one or more files: `sha1sum {{path/to/file1 path/to/file2 ...}}` * Calculate and save the list of SHA1 checksums to a file: `sha1sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha1}}` * Calculate a SHA1 checksum from `stdin`: `{{command}} | sha1sum` * Read a file of SHA1 sums and filenames and verify all files have matching checksums: `sha1sum --check {{path/to/file.sha1}}` * Only show a message for missing files or when verification fails: `sha1sum --check --quiet {{path/to/file.sha1}}` * Only show a message when verification fails, ignoring missing files: `sha1sum --ignore-missing --check --quiet {{path/to/file.sha1}}`
What is ed command
# ed > The original Unix text editor. See also: `awk`, `sed`. More information: > https://www.gnu.org/software/ed/manual/ed_manual.html. * Start an interactive editor session with an empty document: `ed` * Start an interactive editor session with an empty document and a specific [p]rompt: `ed -p '> '` * Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt: `ed -s` * Edit a specific file (this shows the byte count of the loaded file): `ed {{path/to/file}}` * Replace a string with a specific replacement for all lines: `,s/{{regular_expression}}/{{replacement}}/g`
What is systemd-analyze command
# systemd-analyze > Analyze and debug system manager. Show timing details about the boot process > of units (services, mount points, devices, sockets). More information: > https://www.freedesktop.org/software/systemd/man/systemd-analyze.html. * List all running units, ordered by the time they took to initialize: `systemd-analyze blame` * Print a tree of the time-critical chain of units: `systemd-analyze critical-chain` * Create an SVG file showing when each system service started, highlighting the time that they spent on initialization: `systemd-analyze plot > {{path/to/file.svg}}` * Plot a dependency graph and convert it to an SVG file: `systemd-analyze dot | dot -T{{svg}} > {{path/to/file.svg}}` * Show security scores of running units: `systemd-analyze security`
What is timeout command
# timeout > Run a command with a time limit. More information: > https://www.gnu.org/software/coreutils/timeout. * Run `sleep 10` and terminate it, if it runs for more than 3 seconds: `timeout {{3s}} {{sleep 10}}` * Specify the signal to be sent to the command after the time limit expires. (By default, TERM is sent): `timeout --signal {{INT}} {{5s}} {{sleep 10}}`
What is git-am command
# git am > Apply patch files and create a commit. Useful when receiving commits via > email. See also `git format-patch`, which can generate patch files. More > information: https://git-scm.com/docs/git-am. * Apply and commit changes following a local patch file: `git am {{path/to/file.patch}}` * Apply and commit changes following a remote patch file: `curl -L {{https://example.com/file.patch}} | git apply` * Abort the process of applying a patch file: `git am --abort` * Apply as much of a patch file as possible, saving failed hunks to reject files: `git am --reject {{path/to/file.patch}}`
What is strings command
# strings > Find printable strings in an object file or binary. More information: > https://manned.org/strings. * Print all strings in a binary: `strings {{path/to/file}}` * Limit results to strings at least length characters long: `strings -n {{length}} {{path/to/file}}` * Prefix each result with its offset within the file: `strings -t d {{path/to/file}}` * Prefix each result with its offset within the file in hexadecimal: `strings -t x {{path/to/file}}`
What is git-pull command
# git pull > Fetch branch from a remote repository and merge it to local repository. More > information: https://git-scm.com/docs/git-pull. * Download changes from default remote repository and merge it: `git pull` * Download changes from default remote repository and use fast-forward: `git pull --rebase` * Download changes from given remote repository and branch, then merge them into HEAD: `git pull {{remote_name}} {{branch}}`
What is yacc command
# yacc > Generate an LALR parser (in C) with a given formal grammar specification > file. See also: `bison`. More information: https://manned.org/man/yacc.1p. * Create a file `y.tab.c` containing the C parser code and compile the grammar file with all necessary constant declarations for values. (Constant declarations file `y.tab.h` is created only when the `-d` flag is used): `yacc -d {{path/to/grammar_file.y}}` * Compile a grammar file containing the description of the parser and a report of conflicts generated by ambiguities in the grammar: `yacc -d {{path/to/grammar_file.y}} -v` * Compile a grammar file, and prefix output filenames with `prefix` instead of `y`: `yacc -d {{path/to/grammar_file.y}} -v -b {{prefix}}`
What is df command
# df > Gives an overview of the filesystem disk space usage. More information: > https://www.gnu.org/software/coreutils/df. * Display all filesystems and their disk usage: `df` * Display all filesystems and their disk usage in human-readable form: `df -h` * Display the filesystem and its disk usage containing the given file or directory: `df {{path/to/file_or_directory}}` * Display statistics on the number of free inodes: `df -i` * Display filesystems but exclude the specified types: `df -x {{squashfs}} -x {{tmpfs}}`
What is ipcmk command
# ipcmk > Create IPC (Inter-process Communication) resources. More information: > https://manned.org/ipcmk. * Create a shared memory segment: `ipcmk --shmem {{segment_size_in_bytes}}` * Create a semaphore: `ipcmk --semaphore {{element_size}}` * Create a message queue: `ipcmk --queue` * Create a shared memory segment with specific permissions (default is 0644): `ipcmk --shmem {{segment_size_in_bytes}} {{octal_permissions}}`
What is newgrp command
# newgrp > Switch primary group membership. More information: > https://manned.org/newgrp. * Change user's primary group membership: `newgrp {{group_name}}` * Reset primary group membership to user's default group in `/etc/passwd`: `newgrp`
What is ssh-agent command
# ssh-agent > Spawn an SSH Agent process. An SSH Agent holds SSH keys decrypted in memory > until removed or the process is killed. See also `ssh-add`, which can add > and manage keys held by an SSH Agent. More information: > https://man.openbsd.org/ssh-agent. * Start an SSH Agent for the current shell: `eval $(ssh-agent)` * Kill the currently running agent: `ssh-agent -k`
What is basenc command
# basenc > Encode or decode file or `stdin` using a specified encoding, to `stdout`. > More information: https://www.gnu.org/software/coreutils/basenc. * Encode a file with base64 encoding: `basenc --base64 {{path/to/file}}` * Decode a file with base64 encoding: `basenc --decode --base64 {{path/to/file}}` * Encode from `stdin` with base32 encoding with 42 columns: `{{command}} | basenc --base32 -w42` * Encode from `stdin` with base32 encoding: `{{command}} | basenc --base32`
What is locale command
# locale > Get locale-specific information. More information: > https://manned.org/locale. * List all global environment variables describing the user's locale: `locale` * List all available locales: `locale --all-locales` * Display all available locales and the associated metadata: `locale --all-locales --verbose` * Display the current date format: `locale date_fmt`
What is unlink command
# unlink > Remove a link to a file from the filesystem. The file contents is lost if > the link is the last one to the file. More information: > https://www.gnu.org/software/coreutils/unlink. * Remove the specified file if it is the last link: `unlink {{path/to/file}}`
What is diff3 command
# diff3 > Compare three files line by line. More information: > https://www.gnu.org/software/diffutils/manual/html_node/Invoking-diff3.html. * Compare files: `diff3 {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}` * Show all changes, outlining conflicts: `diff3 --show-all {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}`
What is gpasswd command
# gpasswd > Administer `/etc/group` and `/etc/gshadow`. More information: > https://manned.org/gpasswd. * Define group administrators: `sudo gpasswd -A {{user1,user2}} {{group}}` * Set the list of group members: `sudo gpasswd -M {{user1,user2}} {{group}}` * Create a password for the named group: `gpasswd {{group}}` * Add a user to the named group: `gpasswd -a {{user}} {{group}}` * Remove a user from the named group: `gpasswd -d {{user}} {{group}}`
What is htop command
# htop > Display dynamic real-time information about running processes. An enhanced > version of `top`. More information: https://htop.dev/. * Start `htop`: `htop` * Start `htop` displaying processes owned by a specific user: `htop --user {{username}}` * Sort processes by a specified `sort_item` (use `htop --sort help` for available options): `htop --sort {{sort_item}}` * See interactive commands while running htop: `?` * Switch to a different tab: `tab` * Display help: `htop --help`
What is git-show command
# git show > Show various types of Git objects (commits, tags, etc.). More information: > https://git-scm.com/docs/git-show. * Show information about the latest commit (hash, message, changes, and other metadata): `git show` * Show information about a given commit: `git show {{commit}}` * Show information about the commit associated with a given tag: `git show {{tag}}` * Show information about the 3rd commit from the HEAD of a branch: `git show {{branch}}~{{3}}` * Show a commit's message in a single line, suppressing the diff output: `git show --oneline -s {{commit}}` * Show only statistics (added/removed characters) about the changed files: `git show --stat {{commit}}` * Show only the list of added, renamed or deleted files: `git show --summary {{commit}}` * Show the contents of a file as it was at a given revision (e.g. branch, tag or commit): `git show {{revision}}:{{path/to/file}}`
What is tar command
# tar > Archiving utility. Often combined with a compression method, such as gzip or > bzip2. More information: https://www.gnu.org/software/tar. * [c]reate an archive and write it to a [f]ile: `tar cf {{path/to/target.tar}} {{path/to/file1 path/to/file2 ...}}` * [c]reate a g[z]ipped archive and write it to a [f]ile: `tar czf {{path/to/target.tar.gz}} {{path/to/file1 path/to/file2 ...}}` * [c]reate a g[z]ipped archive from a directory using relative paths: `tar czf {{path/to/target.tar.gz}} --directory={{path/to/directory}} .` * E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely: `tar xvf {{path/to/source.tar[.gz|.bz2|.xz]}}` * E[x]tract a (compressed) archive [f]ile into the target directory: `tar xf {{path/to/source.tar[.gz|.bz2|.xz]}} --directory={{path/to/directory}}` * [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program: `tar caf {{path/to/target.tar.xz}} {{path/to/file1 path/to/file2 ...}}` * Lis[t] the contents of a tar [f]ile [v]erbosely: `tar tvf {{path/to/source.tar}}` * E[x]tract files matching a pattern from an archive [f]ile: `tar xf {{path/to/source.tar}} --wildcards "{{*.html}}"`
What is pr command
# pr > Paginate or columnate files for printing. More information: > https://www.gnu.org/software/coreutils/pr. * Print multiple files with a default header and footer: `pr {{file1}} {{file2}} {{file3}}` * Print with a custom centered header: `pr -h "{{header}}" {{file1}} {{file2}} {{file3}}` * Print with numbered lines and a custom date format: `pr -n -D "{{format}}" {{file1}} {{file2}} {{file3}}` * Print all files together, one in each column, without a header or footer: `pr -m -T {{file1}} {{file2}} {{file3}}` * Print, beginning at page 2 up to page 5, with a given page length (including header and footer): `pr +{{2}}:{{5}} -l {{page_length}} {{file1}} {{file2}} {{file3}}` * Print with an offset for each line and a truncating custom page width: `pr -o {{offset}} -W {{width}} {{file1}} {{file2}} {{file3}}`
What is git-restore command
# git restore > Restore working tree files. Requires Git version 2.23+. See also `git > checkout` and `git reset`. More information: https://git-scm.com/docs/git- > restore. * Restore an unstaged file to the version of the current commit (HEAD): `git restore {{path/to/file}}` * Restore an unstaged file to the version of a specific commit: `git restore --source {{commit}} {{path/to/file}}` * Discard all unstaged changes to tracked files: `git restore :/` * Unstage a file: `git restore --staged {{path/to/file}}` * Unstage all files: `git restore --staged :/` * Discard all changes to files, both staged and unstaged: `git restore --worktree --staged :/` * Interactively select sections of files to restore: `git restore --patch`
What is git-archive command
# git archive > Create an archive of files from a named tree. More information: https://git- > scm.com/docs/git-archive. * Create a tar archive from the contents of the current HEAD and print it to `stdout`: `git archive --verbose HEAD` * Create a zip archive from the current HEAD and print it to `stdout`: `git archive --verbose --format=zip HEAD` * Same as above, but write the zip archive to file: `git archive --verbose --output={{path/to/file.zip}} HEAD` * Create a tar archive from the contents of the latest commit on a specific branch: `git archive --output={{path/to/file.tar}} {{branch_name}}` * Create a tar archive from the contents of a specific directory: `git archive --output={{path/to/file.tar}} HEAD:{{path/to/directory}}` * Prepend a path to each file to archive it inside a specific directory: `git archive --output={{path/to/file.tar}} --prefix={{path/to/prepend}}/ HEAD`
What is uname command
# uname > Print details about the current machine and the operating system running on > it. Note: for additional information about the operating system, try the > `sw_vers` command. More information: https://ss64.com/osx/uname.html. * Print kernel name: `uname` * Print system architecture and processor information: `uname -mp` * Print kernel name, kernel release and kernel version: `uname -srv` * Print system hostname: `uname -n` * Print all available system information: `uname -a`
What is tee command
# tee > Read from `stdin` and write to `stdout` and files (or commands). More > information: https://www.gnu.org/software/coreutils/tee. * Copy `stdin` to each file, and also to `stdout`: `echo "example" | tee {{path/to/file}}` * Append to the given files, do not overwrite: `echo "example" | tee -a {{path/to/file}}` * Print `stdin` to the terminal, and also pipe it into another program for further processing: `echo "example" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}` * Create a directory called "example", count the number of characters in "example" and write "example" to the terminal: `echo "example" | tee >(xargs mkdir) >(wc -c)`
What is join command
# join > Join lines of two sorted files on a common field. More information: > https://www.gnu.org/software/coreutils/join. * Join two files on the first (default) field: `join {{file1}} {{file2}}` * Join two files using a comma (instead of a space) as the field separator: `join -t {{','}} {{file1}} {{file2}}` * Join field3 of file1 with field1 of file2: `join -1 {{3}} -2 {{1}} {{file1}} {{file2}}` * Produce a line for each unpairable line for file1: `join -a {{1}} {{file1}} {{file2}}` * Join a file from `stdin`: `cat {{path/to/file1}} | join - {{path/to/file2}}`
What is pidof command
# pidof > Gets the ID of a process using its name. More information: > https://manned.org/pidof. * List all process IDs with given name: `pidof {{bash}}` * List a single process ID with given name: `pidof -s {{bash}}` * List process IDs including scripts with given name: `pidof -x {{script.py}}` * Kill all processes with given name: `kill $(pidof {{name}})`
What is wait command
# wait > Wait for a process to complete before proceeding. More information: > https://manned.org/wait. * Wait for a process to finish given its process ID (PID) and return its exit status: `wait {{pid}}` * Wait for all processes known to the invoking shell to finish: `wait`
What is git-difftool command
# git difftool > Show file changes using external diff tools. Accepts the same options and > arguments as `git diff`. See also: `git diff`. More information: > https://git-scm.com/docs/git-difftool. * List available diff tools: `git difftool --tool-help` * Set the default diff tool to meld: `git config --global diff.tool "{{meld}}"` * Use the default diff tool to show staged changes: `git difftool --staged` * Use a specific tool (opendiff) to show changes since a given commit: `git difftool --tool={{opendiff}} {{commit}}`
What is wc command
# wc > Count lines, words, or bytes. More information: > https://ss64.com/osx/wc.html. * Count lines in file: `wc -l {{path/to/file}}` * Count words in file: `wc -w {{path/to/file}}` * Count characters (bytes) in file: `wc -c {{path/to/file}}` * Count characters in file (taking multi-byte character sets into account): `wc -m {{path/to/file}}` * Use `stdin` to count lines, words and characters (bytes) in that order: `{{find .}} | wc`
What is passwd command
# passwd > Passwd is a tool used to change a user's password. More information: > https://manned.org/passwd. * Change the password of the current user interactively: `passwd` * Change the password of a specific user: `passwd {{username}}` * Get the current status of the user: `passwd -S` * Make the password of the account blank (it will set the named account passwordless): `passwd -d`
What is command command
# command > Command forces the shell to execute the program and ignore any functions, > builtins and aliases with the same name. More information: > https://manned.org/command. * Execute the `ls` program literally, even if an `ls` alias exists: `command {{ls}}` * Display the path to the executable or the alias definition of a specific command: `command -v {{command_name}}`
What is getent command
# getent > Get entries from Name Service Switch libraries. More information: > https://manned.org/getent. * Get list of all groups: `getent group` * See the members of a group: `getent group {{group_name}}` * Get list of all services: `getent services` * Find a username by UID: `getent passwd 1000` * Perform a reverse DNS lookup: `getent hosts {{host}}`
What is dd command
# dd > Convert and copy a file. More information: https://keith.github.io/xcode- > man-pages/dd.1.html. * Make a bootable USB drive from an isohybrid file (such like `archlinux-xxx.iso`) and show the progress: `dd if={{path/to/file.iso}} of={{/dev/usb_device}} status=progress` * Clone a drive to another drive with 4 MB block, ignore error and show the progress: `dd if={{/dev/source_device}} of={{/dev/dest_device}} bs={{4m}} conv={{noerror}} status=progress` * Generate a file of 100 random bytes by using kernel random driver: `dd if=/dev/urandom of={{path/to/random_file}} bs={{100}} count={{1}}` * Benchmark the write performance of a disk: `dd if=/dev/zero of={{path/to/1GB_file}} bs={{1024}} count={{1000000}}` * Generate a system backup into an IMG file and show the progress: `dd if=/dev/{{drive_device}} of={{path/to/file.img}} status=progress` * Restore a drive from an IMG file and show the progress: `dd if={{path/to/file.img}} of={{/dev/drive_device}} status=progress` * Check the progress of an ongoing dd operation (run this command from another shell): `kill -USR1 $(pgrep ^dd)`
What is join command
# join > Join lines of two sorted files on a common field. More information: > https://www.gnu.org/software/coreutils/join. * Join two files on the first (default) field: `join {{file1}} {{file2}}` * Join two files using a comma (instead of a space) as the field separator: `join -t {{','}} {{file1}} {{file2}}` * Join field3 of file1 with field1 of file2: `join -1 {{3}} -2 {{1}} {{file1}} {{file2}}` * Produce a line for each unpairable line for file1: `join -a {{1}} {{file1}} {{file2}}` * Join a file from `stdin`: `cat {{path/to/file1}} | join - {{path/to/file2}}`
What is bg command
# bg > Resumes jobs that have been suspended (e.g. using `Ctrl + Z`), and keeps > them running in the background. More information: https://manned.org/bg. * Resume the most recently suspended job and run it in the background: `bg` * Resume a specific job (use `jobs -l` to get its ID) and run it in the background: `bg %{{job_id}}`