system
stringclasses
1 value
command
stringlengths
1
20
response
stringlengths
101
1.77k
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
jobs
# jobs > Display status of jobs in the current session. More information: > https://manned.org/jobs. * Show status of all jobs: `jobs` * Show status of a particular job: `jobs %{{job_id}}` * Show status and process IDs of all jobs: `jobs -l` * Show process IDs of all jobs: `jobs -p`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
link
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
tail
# tail > Display the last part of a file. See also: `head`. More information: > https://manned.org/man/freebsd-13.0/tail.1. * Show last 'count' lines in file: `tail -n {{8}} {{path/to/file}}` * Print a file from a specific line number: `tail -n +{{8}} {{path/to/file}}` * Print a specific count of bytes from the end of a given file: `tail -c {{8}} {{path/to/file}}` * Print the last lines of a given file and keep reading file until `Ctrl + C`: `tail -f {{path/to/file}}` * Keep reading file until `Ctrl + C`, even if the file is inaccessible: `tail -F {{path/to/file}}` * Show last 'count' lines in 'file' and refresh every 'seconds' seconds: `tail -n {{8}} -s {{10}} -f {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
sort
# sort > Sort lines of text files. More information: > https://www.gnu.org/software/coreutils/sort. * Sort a file in ascending order: `sort {{path/to/file}}` * Sort a file in descending order: `sort --reverse {{path/to/file}}` * Sort a file in case-insensitive way: `sort --ignore-case {{path/to/file}}` * Sort a file using numeric rather than alphabetic order: `sort --numeric-sort {{path/to/file}}` * Sort `/etc/passwd` by the 3rd field of each line numerically, using ":" as a field separator: `sort --field-separator={{:}} --key={{3n}} {{/etc/passwd}}` * Sort a file preserving only unique lines: `sort --unique {{path/to/file}}` * Sort a file, printing the output to the specified output file (can be used to sort a file in-place): `sort --output={{path/to/file}} {{path/to/file}}` * Sort numbers with exponents: `sort --general-numeric-sort {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
echo
# echo > Print given arguments. More information: > https://www.gnu.org/software/coreutils/echo. * Print a text message. Note: quotes are optional: `echo "{{Hello World}}"` * Print a message with environment variables: `echo "{{My path is $PATH}}"` * Print a message without the trailing newline: `echo -n "{{Hello World}}"` * Append a message to the file: `echo "{{Hello World}}" >> {{file.txt}}` * Enable interpretation of backslash escapes (special characters): `echo -e "{{Column 1\tColumn 2}}"` * Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are `echo %errorlevel%` and `$lastexitcode` respectively): `echo $?`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
arch
# arch > Display the name of the system architecture, or run a command under a > different architecture. See also `uname`. More information: > https://www.unix.com/man-page/osx/1/arch/. * Display the system's architecture: `arch` * Run a command using x86_64: `arch -x86_64 "{{command}}"` * Run a command using arm: `arch -arm64 "{{command}}"`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
test
# test > Check file types and compare values. Returns 0 if the condition evaluates to > true, 1 if it evaluates to false. More information: > https://www.gnu.org/software/coreutils/test. * Test if a given variable is equal to a given string: `test "{{$MY_VAR}}" == "{{/bin/zsh}}"` * Test if a given variable is empty: `test -z "{{$GIT_BRANCH}}"` * Test if a file exists: `test -f "{{path/to/file_or_directory}}"` * Test if a directory does not exist: `test ! -d "{{path/to/directory}}"` * If A is true, then do B, or C in the case of an error (notice that C may run even if A fails): `test {{condition}} && {{echo "true"}} || {{echo "false"}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
uniq
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
yacc
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
stty
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
grep
# 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}}"`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
size
# size > Displays the sizes of sections inside binary files. More information: > https://sourceware.org/binutils/docs/binutils/size.html. * Display the size of sections in a given object or executable file: `size {{path/to/file}}` * Display the size of sections in a given object or executable file in [o]ctal: `size {{-o|--radix=8}} {{path/to/file}}` * Display the size of sections in a given object or executable file in [d]ecimal: `size {{-d|--radix=10}} {{path/to/file}}` * Display the size of sections in a given object or executable file in he[x]adecimal: `size {{-x|--radix=16}} {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
test
# test > Check file types and compare values. Returns 0 if the condition evaluates to > true, 1 if it evaluates to false. More information: > https://www.gnu.org/software/coreutils/test. * Test if a given variable is equal to a given string: `test "{{$MY_VAR}}" == "{{/bin/zsh}}"` * Test if a given variable is empty: `test -z "{{$GIT_BRANCH}}"` * Test if a file exists: `test -f "{{path/to/file_or_directory}}"` * Test if a directory does not exist: `test ! -d "{{path/to/directory}}"` * If A is true, then do B, or C in the case of an error (notice that C may run even if A fails): `test {{condition}} && {{echo "true"}} || {{echo "false"}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
head
# head > Output the first part of files. More information: > https://keith.github.io/xcode-man-pages/head.1.html. * Output the first few lines of a file: `head --lines {{8}} {{path/to/file}}` * Output the first few bytes of a file: `head --bytes {{8}} {{path/to/file}}` * Output everything but the last few lines of a file: `head --lines -{{8}} {{path/to/file}}` * Output everything but the last few bytes of a file: `head --bytes -{{8}} {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
wait
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
gawk
# gawk > This command is an alias of GNU `awk`. * View documentation for the original command: `tldr -p linux awk`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
tput
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
join
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
pwdx
# pwdx > Print working directory of a process. More information: > https://manned.org/pwdx. * Print current working directory of a process: `pwdx {{process_id}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
file
# file > Determine file type. More information: https://manned.org/file. * Give a description of the type of the specified file. Works fine for files with no file extension: `file {{path/to/file}}` * Look inside a zipped file and determine the file type(s) inside: `file -z {{foo.zip}}` * Allow file to work with special or device files: `file -s {{path/to/file}}` * Don't stop at first file type match; keep going until the end of the file: `file -k {{path/to/file}}` * Determine the MIME encoding type of a file: `file -i {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
trap
# trap > Automatically execute commands after receiving signals by processes or the > operating system. Can be used to perform cleanups for interruptions by the > user or other actions. More information: https://manned.org/trap. * List available signals to set traps for: `trap -l` * List active traps for the current shell: `trap -p` * Set a trap to execute commands when one or more signals are detected: `trap 'echo "Caught signal {{SIGHUP}}"' {{SIGHUP}}` * Remove active traps: `trap - {{SIGHUP}} {{SIGINT}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
find
# find > Find files or directories under the given directory tree, recursively. More > information: https://manned.org/find. * Find files by extension: `find {{root_path}} -name '{{*.ext}}'` * Find files matching multiple path/name patterns: `find {{root_path}} -path '{{**/path/**/*.ext}}' -or -name '{{*pattern*}}'` * Find directories matching a given name, in case-insensitive mode: `find {{root_path}} -type d -iname '{{*lib*}}'` * Find files matching a given pattern, excluding specific paths: `find {{root_path}} -name '{{*.py}}' -not -path '{{*/site-packages/*}}'` * Find files matching a given size range, limiting the recursive depth to "1": `find {{root_path}} -maxdepth 1 -size {{+500k}} -size {{-10M}}` * Run a command for each file (use `{}` within the command to access the filename): `find {{root_path}} -name '{{*.ext}}' -exec {{wc -l {} }}\;` * Find files modified in the last 7 days: `find {{root_path}} -daystart -mtime -{{7}}` * Find empty (0 byte) files and delete them: `find {{root_path}} -type {{f}} -empty -delete`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
free
# free > Display amount of free and used memory in the system. More information: > https://manned.org/free. * Display system memory: `free` * Display memory in Bytes/KB/MB/GB: `free -{{b|k|m|g}}` * Display memory in human-readable units: `free -h` * Refresh the output every 2 seconds: `free -s {{2}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
fold
# fold > Wrap each line in an input file to fit a specified width and print it to > `stdout`. More information: https://manned.org/fold.1p. * Wrap each line to default width (80 characters): `fold {{path/to/file}}` * Wrap each line to width "30": `fold -w30 {{path/to/file}}` * Wrap each line to width "5" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped): `fold -w5 -s {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
sftp
# sftp > Secure File Transfer Program. Interactive program to copy files between > hosts over SSH. For non-interactive file transfers, see `scp` or `rsync`. > More information: https://manned.org/sftp. * Connect to a remote server and enter an interactive command mode: `sftp {{remote_user}}@{{remote_host}}` * Connect using an alternate port: `sftp -P {{remote_port}} {{remote_user}}@{{remote_host}}` * Connect using a predefined host (in `~/.ssh/config`): `sftp {{host}}` * Transfer remote file to the local system: `get {{/path/remote_file}}` * Transfer local file to the remote system: `put {{/path/local_file}}` * Transfer remote directory to the local system recursively (works with `put` too): `get -R {{/path/remote_directory}}` * Get list of files on local machine: `lls` * Get list of files on remote machine: `ls`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
tail
# tail > Display the last part of a file. See also: `head`. More information: > https://manned.org/man/freebsd-13.0/tail.1. * Show last 'count' lines in file: `tail -n {{8}} {{path/to/file}}` * Print a file from a specific line number: `tail -n +{{8}} {{path/to/file}}` * Print a specific count of bytes from the end of a given file: `tail -c {{8}} {{path/to/file}}` * Print the last lines of a given file and keep reading file until `Ctrl + C`: `tail -f {{path/to/file}}` * Keep reading file until `Ctrl + C`, even if the file is inaccessible: `tail -F {{path/to/file}}` * Show last 'count' lines in 'file' and refresh every 'seconds' seconds: `tail -n {{8}} -s {{10}} -f {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
find
# find > Find files or directories under the given directory tree, recursively. More > information: https://manned.org/find. * Find files by extension: `find {{root_path}} -name '{{*.ext}}'` * Find files matching multiple path/name patterns: `find {{root_path}} -path '{{**/path/**/*.ext}}' -or -name '{{*pattern*}}'` * Find directories matching a given name, in case-insensitive mode: `find {{root_path}} -type d -iname '{{*lib*}}'` * Find files matching a given pattern, excluding specific paths: `find {{root_path}} -name '{{*.py}}' -not -path '{{*/site-packages/*}}'` * Find files matching a given size range, limiting the recursive depth to "1": `find {{root_path}} -maxdepth 1 -size {{+500k}} -size {{-10M}}` * Run a command for each file (use `{}` within the command to access the filename): `find {{root_path}} -name '{{*.ext}}' -exec {{wc -l {} }}\;` * Find files modified in the last 7 days: `find {{root_path}} -daystart -mtime -{{7}}` * Find empty (0 byte) files and delete them: `find {{root_path}} -type {{f}} -empty -delete`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
more
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
make
# make > Task runner for targets described in Makefile. Mostly used to control the > compilation of an executable from source code. More information: > https://www.gnu.org/software/make/manual/make.html. * Call the first target specified in the Makefile (usually named "all"): `make` * Call a specific target: `make {{target}}` * Call a specific target, executing 4 jobs at a time in parallel: `make -j{{4}} {{target}}` * Use a specific Makefile: `make --file {{path/to/file}}` * Execute make from another directory: `make --directory {{path/to/directory}}` * Force making of a target, even if source files are unchanged: `make --always-make {{target}}` * Override a variable defined in the Makefile: `make {{target}} {{variable}}={{new_value}}` * Override variables defined in the Makefile by the environment: `make --environment-overrides {{target}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
mesg
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
make
# make > Task runner for targets described in Makefile. Mostly used to control the > compilation of an executable from source code. More information: > https://www.gnu.org/software/make/manual/make.html. * Call the first target specified in the Makefile (usually named "all"): `make` * Call a specific target: `make {{target}}` * Call a specific target, executing 4 jobs at a time in parallel: `make -j{{4}} {{target}}` * Use a specific Makefile: `make --file {{path/to/file}}` * Execute make from another directory: `make --directory {{path/to/directory}}` * Force making of a target, even if source files are unchanged: `make --always-make {{target}}` * Override a variable defined in the Makefile: `make {{target}} {{variable}}={{new_value}}` * Override variables defined in the Makefile by the environment: `make --environment-overrides {{target}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
look
# look > Look for lines in sorted file. More information: https://manned.org/look. * Look for lines which begins with the given prefix: `look {{prefix}} {{path/to/file}}` * Look for lines ignoring case: `look --ignore-case {{prefix}} {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
join
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
time
# time > Measure how long a command took to run. Note: `time` can either exist as a > shell builtin, a standalone program or both. More information: > https://manned.org/time. * Run the `command` and print the time measurements to `stdout`: `time {{command}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
diff
# diff > Compare files and directories. More information: https://man7.org/linux/man- > pages/man1/diff.1.html. * Compare files (lists changes to turn `old_file` into `new_file`): `diff {{old_file}} {{new_file}}` * Compare files, ignoring white spaces: `diff --ignore-all-space {{old_file}} {{new_file}}` * Compare files, showing the differences side by side: `diff --side-by-side {{old_file}} {{new_file}}` * Compare files, showing the differences in unified format (as used by `git diff`): `diff --unified {{old_file}} {{new_file}}` * Compare directories recursively (shows names for differing files/directories as well as changes made to files): `diff --recursive {{old_directory}} {{new_directory}}` * Compare directories, only showing the names of files that differ: `diff --recursive --brief {{old_directory}} {{new_directory}}` * Create a patch file for Git from the differences of two text files, treating nonexistent files as empty: `diff --text --unified --new-file {{old_file}} {{new_file}} > {{diff.patch}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
dash
# dash > Debian Almquist Shell, a modern, POSIX-compliant implementation of `sh` (not > Bash-compatible). More information: https://manned.org/dash. * Start an interactive shell session: `dash` * Execute specific [c]ommands: `dash -c "{{echo 'dash is executed'}}"` * Execute a specific script: `dash {{path/to/script.sh}}` * Check a specific script for syntax errors: `dash -n {{path/to/script.sh}}` * Execute a specific script while printing each command before executing it: `dash -x {{path/to/script.sh}}` * Execute a specific script and stop at the first [e]rror: `dash -e {{path/to/script.sh}}` * Execute specific commands from `stdin`: `{{echo "echo 'dash is executed'"}} | dash`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
curl
# curl > Transfers data from or to a server. Supports most protocols, including HTTP, > FTP, and POP3. More information: https://curl.se/docs/manpage.html. * Download the contents of a URL to a file: `curl {{http://example.com}} --output {{path/to/file}}` * Download a file, saving the output under the filename indicated by the URL: `curl --remote-name {{http://example.com/filename}}` * Download a file, following location redirects, and automatically continuing (resuming) a previous file transfer and return an error on server error: `curl --fail --remote-name --location --continue-at - {{http://example.com/filename}}` * Send form-encoded data (POST request of type `application/x-www-form-urlencoded`). Use `--data @file_name` or `--data @'-'` to read from STDIN: `curl --data {{'name=bob'}} {{http://example.com/form}}` * Send a request with an extra header, using a custom HTTP method: `curl --header {{'X-My-Header: 123'}} --request {{PUT}} {{http://example.com}}` * Send data in JSON format, specifying the appropriate content-type header: `curl --data {{'{"name":"bob"}'}} --header {{'Content-Type: application/json'}} {{http://example.com/users/1234}}` * Pass a username and password for server authentication: `curl --user myusername:mypassword {{http://example.com}}` * Pass client certificate and key for a resource, skipping certificate validation: `curl --cert {{client.pem}} --key {{key.pem}} --insecure {{https://example.com}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
less
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
nice
# nice > Execute a program with a custom scheduling priority (niceness). Niceness > values range from -20 (the highest priority) to 19 (the lowest). More > information: https://www.gnu.org/software/coreutils/nice. * Launch a program with altered priority: `nice -n {{niceness_value}} {{command}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
chfn
# chfn > Update `finger` info for a user. More information: https://manned.org/chfn. * Update a user's "Name" field in the output of `finger`: `chfn -f {{new_display_name}} {{username}}` * Update a user's "Office Room Number" field for the output of `finger`: `chfn -o {{new_office_room_number}} {{username}}` * Update a user's "Office Phone Number" field for the output of `finger`: `chfn -p {{new_office_telephone_number}} {{username}}` * Update a user's "Home Phone Number" field for the output of `finger`: `chfn -h {{new_home_telephone_number}} {{username}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
type
# type > Display the type of command the shell will execute. More information: > https://manned.org/type. * Display the type of a command: `type {{command}}` * Display all locations containing the specified executable: `type -a {{command}}` * Display the name of the disk file that would be executed: `type -p {{command}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
bash
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
stty
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
link
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
gitk
# gitk > A graphical Git repository browser. More information: https://git- > scm.com/docs/gitk. * Show the repository browser for the current Git repository: `gitk` * Show repository browser for a specific file or directory: `gitk {{path/to/file_or_directory}}` * Show commits made since 1 week ago: `gitk --since="{{1 week ago}}"` * Show commits older than 1/1/2016: `gitk --until="{{1/1/2015}}"` * Show at most 100 changes in all branches: `gitk --max-count={{100}} --all`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
diff
# diff > Compare files and directories. More information: https://man7.org/linux/man- > pages/man1/diff.1.html. * Compare files (lists changes to turn `old_file` into `new_file`): `diff {{old_file}} {{new_file}}` * Compare files, ignoring white spaces: `diff --ignore-all-space {{old_file}} {{new_file}}` * Compare files, showing the differences side by side: `diff --side-by-side {{old_file}} {{new_file}}` * Compare files, showing the differences in unified format (as used by `git diff`): `diff --unified {{old_file}} {{new_file}}` * Compare directories recursively (shows names for differing files/directories as well as changes made to files): `diff --recursive {{old_directory}} {{new_directory}}` * Compare directories, only showing the names of files that differ: `diff --recursive --brief {{old_directory}} {{new_directory}}` * Create a patch file for Git from the differences of two text files, treating nonexistent files as empty: `diff --text --unified --new-file {{old_file}} {{new_file}} > {{diff.patch}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
wget
# wget > Download files from the Web. Supports HTTP, HTTPS, and FTP. More > information: https://www.gnu.org/software/wget. * Download the contents of a URL to a file (named "foo" in this case): `wget {{https://example.com/foo}}` * Download the contents of a URL to a file (named "bar" in this case): `wget --output-document {{bar}} {{https://example.com/foo}}` * Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.): `wget --page-requisites --convert-links --wait=3 {{https://example.com/somepage.html}}` * Download all listed files within a directory and its sub-directories (does not download embedded page elements): `wget --mirror --no-parent {{https://example.com/somepath/}}` * Limit the download speed and the number of connection retries: `wget --limit-rate={{300k}} --tries={{100}} {{https://example.com/somepath/}}` * Download a file from an HTTP server using Basic Auth (also works for FTP): `wget --user={{username}} --password={{password}} {{https://example.com}}` * Continue an incomplete download: `wget --continue {{https://example.com}}` * Download all URLs stored in a text file to a specific directory: `wget --directory-prefix {{path/to/directory}} --input-file {{URLs.txt}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
chsh
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
date
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
kill
# kill > Sends a signal to a process, usually related to stopping the process. All > signals except for SIGKILL and SIGSTOP can be intercepted by the process to > perform a clean exit. More information: https://manned.org/kill. * Terminate a program using the default SIGTERM (terminate) signal: `kill {{process_id}}` * List available signal names (to be used without the `SIG` prefix): `kill -l` * Terminate a background job: `kill %{{job_id}}` * Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating: `kill -{{1|HUP}} {{process_id}}` * Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`: `kill -{{2|INT}} {{process_id}}` * Signal the operating system to immediately terminate a program (which gets no chance to capture the signal): `kill -{{9|KILL}} {{process_id}}` * Signal the operating system to pause a program until a SIGCONT ("continue") signal is received: `kill -{{17|STOP}} {{process_id}}` * Send a `SIGUSR1` signal to all processes with the given GID (group id): `kill -{{SIGUSR1}} -{{group_id}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
kill
# kill > Sends a signal to a process, usually related to stopping the process. All > signals except for SIGKILL and SIGSTOP can be intercepted by the process to > perform a clean exit. More information: https://manned.org/kill. * Terminate a program using the default SIGTERM (terminate) signal: `kill {{process_id}}` * List available signal names (to be used without the `SIG` prefix): `kill -l` * Terminate a background job: `kill %{{job_id}}` * Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating: `kill -{{1|HUP}} {{process_id}}` * Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`: `kill -{{2|INT}} {{process_id}}` * Signal the operating system to immediately terminate a program (which gets no chance to capture the signal): `kill -{{9|KILL}} {{process_id}}` * Signal the operating system to pause a program until a SIGCONT ("continue") signal is received: `kill -{{17|STOP}} {{process_id}}` * Send a `SIGUSR1` signal to all processes with the given GID (group id): `kill -{{SIGUSR1}} -{{group_id}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
chsh
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
exit
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
comm
# comm > Select or reject lines common to two files. Both files must be sorted. More > information: https://www.gnu.org/software/coreutils/comm. * Produce three tab-separated columns: lines only in first file, lines only in second file and common lines: `comm {{file1}} {{file2}}` * Print only lines common to both files: `comm -12 {{file1}} {{file2}}` * Print only lines common to both files, reading one file from `stdin`: `cat {{file1}} | comm -12 - {{file2}}` * Get lines only found in first file, saving the result to a third file: `comm -23 {{file1}} {{file2}} > {{file1_only}}` * Print lines only found in second file, when the files aren't sorted: `comm -13 <(sort {{file1}}) <(sort {{file2}})`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
ipcs
# ipcs > Display information about resources used in IPC (Inter-process > Communication). More information: https://manned.org/ipcs. * Specific information about the Message Queue which has the ID 32768: `ipcs -qi 32768` * General information about all the IPC: `ipcs -a`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
true
# true > Returns a successful exit status code of 0. Use this with the || operator to > make a command always exit with 0. More information: > https://www.gnu.org/software/coreutils/true. * Return a successful exit code: `true`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
wall
# wall > Write a message on the terminals of users currently logged in. More > information: https://manned.org/wall. * Send a message: `wall {{message}}` * Send a message to users that belong to a specific group: `wall --group {{group_name}} {{message}}` * Send a message from a file: `wall {{file}}` * Send a message with timeout (default 300): `wall --timeout {{seconds}} {{file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
head
# head > Output the first part of files. More information: > https://keith.github.io/xcode-man-pages/head.1.html. * Output the first few lines of a file: `head --lines {{8}} {{path/to/file}}` * Output the first few bytes of a file: `head --bytes {{8}} {{path/to/file}}` * Output everything but the last few lines of a file: `head --lines -{{8}} {{path/to/file}}` * Output everything but the last few bytes of a file: `head --bytes -{{8}} {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
stat
# stat > Display file status. More information: https://ss64.com/osx/stat.html. * Show file properties such as size, permissions, creation and access dates among others: `stat {{path/to/file}}` * Same as above but verbose (more similar to Linux's `stat`): `stat -x {{path/to/file}}` * Show only octal file permissions: `stat -f %Mp%Lp {{path/to/file}}` * Show owner and group of the file: `stat -f "%Su %Sg" {{path/to/file}}` * Show the size of the file in bytes: `stat -f "%z %N" {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
shuf
# shuf > Generate random permutations. More information: https://www.unix.com/man- > page/linux/1/shuf/. * Randomize the order of lines in a file and output the result: `shuf {{filename}}` * Only output the first 5 entries of the result: `shuf --head-count={{5}} {{filename}}` * Write output to another file: `shuf {{filename}} --output={{output_filename}}` * Generate random numbers in range 1-10: `shuf --input-range={{1-10}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
sort
# sort > Sort lines of text files. More information: > https://www.gnu.org/software/coreutils/sort. * Sort a file in ascending order: `sort {{path/to/file}}` * Sort a file in descending order: `sort --reverse {{path/to/file}}` * Sort a file in case-insensitive way: `sort --ignore-case {{path/to/file}}` * Sort a file using numeric rather than alphabetic order: `sort --numeric-sort {{path/to/file}}` * Sort `/etc/passwd` by the 3rd field of each line numerically, using ":" as a field separator: `sort --field-separator={{:}} --key={{3n}} {{/etc/passwd}}` * Sort a file preserving only unique lines: `sort --unique {{path/to/file}}` * Sort a file, printing the output to the specified output file (can be used to sort a file in-place): `sort --output={{path/to/file}} {{path/to/file}}` * Sort numbers with exponents: `sort --general-numeric-sort {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
chfn
# chfn > Update `finger` info for a user. More information: https://manned.org/chfn. * Update a user's "Name" field in the output of `finger`: `chfn -f {{new_display_name}} {{username}}` * Update a user's "Office Room Number" field for the output of `finger`: `chfn -o {{new_office_room_number}} {{username}}` * Update a user's "Office Phone Number" field for the output of `finger`: `chfn -p {{new_office_telephone_number}} {{username}}` * Update a user's "Home Phone Number" field for the output of `finger`: `chfn -h {{new_home_telephone_number}} {{username}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
more
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
sync
# sync > Flushes all pending write operations to the appropriate disks. More > information: https://www.gnu.org/software/coreutils/sync. * Flush all pending write operations on all disks: `sync` * Flush all pending write operations on a single file to disk: `sync {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
file
# file > Determine file type. More information: https://manned.org/file. * Give a description of the type of the specified file. Works fine for files with no file extension: `file {{path/to/file}}` * Look inside a zipped file and determine the file type(s) inside: `file -z {{foo.zip}}` * Allow file to work with special or device files: `file -s {{path/to/file}}` * Don't stop at first file type match; keep going until the end of the file: `file -k {{path/to/file}}` * Determine the MIME encoding type of a file: `file -i {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
time
# time > Measure how long a command took to run. Note: `time` can either exist as a > shell builtin, a standalone program or both. More information: > https://manned.org/time. * Run the `command` and print the time measurements to `stdout`: `time {{command}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
dpkg
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
expr
# expr > Evaluate expressions and manipulate strings. More information: > https://www.gnu.org/software/coreutils/expr. * Get the length of a specific string: `expr length "{{string}}"` * Get the substring of a string with a specific length: `expr substr "{{string}}" {{from}} {{length}}` * Match a specific substring against an anchored pattern: `expr match "{{string}}" '{{pattern}}'` * Get the first char position from a specific set in a string: `expr index "{{string}}" "{{chars}}"` * Calculate a specific mathematic expression: `expr {{expression1}} {{+|-|*|/|%}} {{expression2}}` * Get the first expression if its value is non-zero and not null otherwise get the second one: `expr {{expression1}} \| {{expression2}}` * Get the first expression if both expressions are non-zero and not null otherwise get zero: `expr {{expression1}} \& {{expression2}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
gcov
# gcov > Code coverage analysis and profiling tool that discovers untested parts of a > program. Also displays a copy of source code annotated with execution > frequencies of code segments. More information: > https://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html. * Generate a coverage report named `file.cpp.gcov`: `gcov {{path/to/file.cpp}}` * Write individual execution counts for every basic block: `gcov --all-blocks {{path/to/file.cpp}}` * Write branch frequencies to the output file and print summary information to `stdout` as a percentage: `gcov --branch-probabilities {{path/to/file.cpp}}` * Write branch frequencies as the number of branches taken, rather than the percentage: `gcov --branch-counts {{path/to/file.cpp}}` * Do not create a `gcov` output file: `gcov --no-output {{path/to/file.cpp}}` * Write file level as well as function level summaries: `gcov --function-summaries {{path/to/file.cpp}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
htop
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
pmap
# pmap > Report memory map of a process or processes. More information: > https://manned.org/pmap. * Print memory map for a specific process id (PID): `pmap {{pid}}` * Show the extended format: `pmap --extended {{pid}}` * Show the device format: `pmap --device {{pid}}` * Limit results to a memory address range specified by `low` and `high`: `pmap --range {{low}},{{high}}` * Print memory maps for multiple processes: `pmap {{pid1 pid2 ...}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
vdir
# vdir > List directory contents. Drop-in replacement for `ls -l`. More information: > https://www.gnu.org/software/coreutils/vdir. * List files and directories in the current directory, one per line, with details: `vdir` * List with sizes displayed in human-readable units (KB, MB, GB): `vdir -h` * List including hidden files (starting with a dot): `vdir -a` * List files and directories sorting entries by size (largest first): `vdir -S` * List files and directories sorting entries by modification time (newest first): `vdir -t` * List grouping directories first: `vdir --group-directories-first` * Recursively list all files and directories in a specific directory: `vdir --recursive {{path/to/directory}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
kill
# kill > Sends a signal to a process, usually related to stopping the process. All > signals except for SIGKILL and SIGSTOP can be intercepted by the process to > perform a clean exit. More information: https://manned.org/kill. * Terminate a program using the default SIGTERM (terminate) signal: `kill {{process_id}}` * List available signal names (to be used without the `SIG` prefix): `kill -l` * Terminate a background job: `kill %{{job_id}}` * Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating: `kill -{{1|HUP}} {{process_id}}` * Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`: `kill -{{2|INT}} {{process_id}}` * Signal the operating system to immediately terminate a program (which gets no chance to capture the signal): `kill -{{9|KILL}} {{process_id}}` * Signal the operating system to pause a program until a SIGCONT ("continue") signal is received: `kill -{{17|STOP}} {{process_id}}` * Send a `SIGUSR1` signal to all processes with the given GID (group id): `kill -{{SIGUSR1}} -{{group_id}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
comm
# comm > Select or reject lines common to two files. Both files must be sorted. More > information: https://www.gnu.org/software/coreutils/comm. * Produce three tab-separated columns: lines only in first file, lines only in second file and common lines: `comm {{file1}} {{file2}}` * Print only lines common to both files: `comm -12 {{file1}} {{file2}}` * Print only lines common to both files, reading one file from `stdin`: `cat {{file1}} | comm -12 - {{file2}}` * Get lines only found in first file, saving the result to a third file: `comm -23 {{file1}} {{file2}} > {{file1_only}}` * Print lines only found in second file, when the files aren't sorted: `comm -13 <(sort {{file1}}) <(sort {{file2}})`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
uniq
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
mesg
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
date
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
exec
# exec > Replace the current process with another process. More information: > https://linuxcommand.org/lc3_man_pages/exech.html. * Replace with the specified command using the current environment variables: `exec {{command -with -flags}}` * Replace with the specified command, clearing environment variables: `exec -c {{command -with -flags}}` * Replace with the specified command and login using the default shell: `exec -l {{command -with -flags}}` * Replace with the specified command and change the process name: `exec -a {{process_name}} {{command -with -flags}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
last
# last > View the last logged in users. More information: https://manned.org/last. * View last logins, their duration and other information as read from `/var/log/wtmp`: `last` * Specify how many of the last logins to show: `last -n {{login_count}}` * Print the full date and time for entries and then display the hostname column last to prevent truncation: `last -F -a` * View all logins by a specific user and show the IP address instead of the hostname: `last {{username}} -i` * View all recorded reboots (i.e., the last logins of the pseudo user "reboot"): `last reboot` * View all recorded shutdowns (i.e., the last logins of the pseudo user "shutdown"): `last shutdown`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
echo
# echo > Print given arguments. More information: > https://www.gnu.org/software/coreutils/echo. * Print a text message. Note: quotes are optional: `echo "{{Hello World}}"` * Print a message with environment variables: `echo "{{My path is $PATH}}"` * Print a message without the trailing newline: `echo -n "{{Hello World}}"` * Append a message to the file: `echo "{{Hello World}}" >> {{file.txt}}` * Enable interpretation of backslash escapes (special characters): `echo -e "{{Column 1\tColumn 2}}"` * Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are `echo %errorlevel%` and `$lastexitcode` respectively): `echo $?`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
nice
# nice > Execute a program with a custom scheduling priority (niceness). Niceness > values range from -20 (the highest priority) to 19 (the lowest). More > information: https://www.gnu.org/software/coreutils/nice. * Launch a program with altered priority: `nice -n {{niceness_value}} {{command}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
chrt
# chrt > Manipulate the real-time attributes of a process. More information: > https://man7.org/linux/man-pages/man1/chrt.1.html. * Display attributes of a process: `chrt --pid {{PID}}` * Display attributes of all threads of a process: `chrt --all-tasks --pid {{PID}}` * Display the min/max priority values that can be used with `chrt`: `chrt --max` * Set the scheduling policy for a process: `chrt --pid {{PID}} --{{deadline|idle|batch|rr|fifo|other}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
perf
# perf > Framework for Linux performance counter measurements. More information: > https://perf.wiki.kernel.org. * Display basic performance counter stats for a command: `perf stat {{gcc hello.c}}` * Display system-wide real-time performance counter profile: `sudo perf top` * Run a command and record its profile into `perf.data`: `sudo perf record {{command}}` * Record the profile of an existing process into `perf.data`: `sudo perf record -p {{pid}}` * Read `perf.data` (created by `perf record`) and display the profile: `sudo perf report`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
tput
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
grep
# 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}}"`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
reset
# reset > Reinitializes the current terminal. Clears the entire terminal screen. More > information: https://manned.org/reset. * Reinitialize the current terminal: `reset` * Display the terminal type instead: `reset -q`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
sleep
# sleep > Delay for a specified amount of time. More information: > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html. * Delay in seconds: `sleep {{seconds}}` * Execute a specific command after 20 seconds delay: `sleep 20 && {{command}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
ctags
# ctags > Generates an index (or tag) file of language objects found in source files > for many popular programming languages. More information: https://ctags.io/. * Generate tags for a single file, and output them to a file named "tags" in the current directory, overwriting the file if it exists: `ctags {{path/to/file}}` * Generate tags for all files in the current directory, and output them to a specific file, overwriting the file if it exists: `ctags -f {{path/to/file}} *` * Generate tags for all files in the current directory and all subdirectories: `ctags --recurse` * Generate tags for a single file, and output them with start line number and end line number in JSON format: `ctags --fields=+ne --output-format=json {{path/to/file}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
chgrp
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
troff
# troff > Typesetting processor for the groff (GNU Troff) document formatting system. > See also `groff`. More information: https://manned.org/troff. * Format output for a PostScript printer, saving the output to a file: `troff {{path/to/input.roff}} | grops > {{path/to/output.ps}}` * Format output for a PostScript printer using the [me] macro package, saving the output to a file: `troff -{{me}} {{path/to/input.roff}} | grops > {{path/to/output.ps}}` * Format output as [a]SCII text using the [man] macro package: `troff -T {{ascii}} -{{man}} {{path/to/input.roff}} | grotty` * Format output as a [pdf] file, saving the output to a file: `troff -T {{pdf}} {{path/to/input.roff}} | gropdf > {{path/to/output.pdf}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
ipcmk
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
sdiff
# sdiff > Compare the differences between and optionally merge 2 files. More > information: https://manned.org/sdiff. * Compare 2 files: `sdiff {{path/to/file1}} {{path/to/file2}}` * Compare 2 files, ignoring all tabs and whitespace: `sdiff -W {{path/to/file1}} {{path/to/file2}}` * Compare 2 files, ignoring whitespace at the end of lines: `sdiff -Z {{path/to/file1}} {{path/to/file2}}` * Compare 2 files in a case-insensitive manner: `sdiff -i {{path/to/file1}} {{path/to/file2}}` * Compare and then merge, writing the output to a new file: `sdiff -o {{path/to/merged_file}} {{path/to/file1}} {{path/to/file2}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
users
# 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}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
ipcrm
# ipcrm > Delete IPC (Inter-process Communication) resources. More information: > https://manned.org/ipcrm. * Delete a shared memory segment by ID: `ipcrm --shmem-id {{shmem_id}}` * Delete a shared memory segment by key: `ipcrm --shmem-key {{shmem_key}}` * Delete an IPC queue by ID: `ipcrm --queue-id {{ipc_queue_id}}` * Delete an IPC queue by key: `ipcrm --queue-key {{ipc_queue_key}}` * Delete a semaphore by ID: `ipcrm --semaphore-id {{semaphore_id}}` * Delete a semaphore by key: `ipcrm --semaphore-key {{semaphore_key}}` * Delete all IPC resources: `ipcrm --all`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
rsync
# rsync > Transfer files either to or from a remote host (but not between two remote > hosts), by default using SSH. To specify a remote path, use > `host:path/to/file_or_directory`. More information: > https://download.samba.org/pub/rsync/rsync.1. * Transfer a file: `rsync {{path/to/source}} {{path/to/destination}}` * Use archive mode (recursively copy directories, copy symlinks without resolving and preserve permissions, ownership and modification times): `rsync --archive {{path/to/source}} {{path/to/destination}}` * Compress the data as it is sent to the destination, display verbose and human-readable progress, and keep partially transferred files if interrupted: `rsync --compress --verbose --human-readable --partial --progress {{path/to/source}} {{path/to/destination}}` * Recursively copy directories: `rsync --recursive {{path/to/source}} {{path/to/destination}}` * Transfer directory contents, but not the directory itself: `rsync --recursive {{path/to/source}}/ {{path/to/destination}}` * Recursively copy directories, use archive mode, resolve symlinks and skip files that are newer on the destination: `rsync --recursive --archive --update --copy-links {{path/to/source}} {{path/to/destination}}` * Transfer a directory to a remote host running `rsyncd` and delete files on the destination that do not exist on the source: `rsync --recursive --delete rsync://{{host}}:{{path/to/source}} {{path/to/destination}}` * Transfer a file over SSH using a different port than the default (22) and show global progress: `rsync --rsh 'ssh -p {{port}}' --info=progress2 {{host}}:{{path/to/source}} {{path/to/destination}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
mkdir
# mkdir > Create directories and set their permissions. More information: > https://www.gnu.org/software/coreutils/mkdir. * Create specific directories: `mkdir {{path/to/directory1 path/to/directory2 ...}}` * Create specific directories and their [p]arents if needed: `mkdir -p {{path/to/directory1 path/to/directory2 ...}}` * Create directories with specific permissions: `mkdir -m {{rwxrw-r--}} {{path/to/directory1 path/to/directory2 ...}}`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
iconv
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
uname
# 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`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
false
# false > Returns a non-zero exit code. More information: > https://www.gnu.org/software/coreutils/false. * Return a non-zero exit code: `false`
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked.
iconv
# 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`