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. | split | # split
> Split a file into pieces. More information: https://ss64.com/osx/split.html.
* Split a file, each split having 10 lines (except the last split):
`split -l {{10}} {{filename}}`
* Split a file by a regular expression. The matching line will be the first line of the next output file:
`split -p {{cat|^[dh]og}} {{filename}}`
* Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):
`split -b {{512}} {{filename}}`
* Split a file into 5 files. File is split such that each split has same size (except the last split):
`split -n {{5}} {{filename}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | patch | # patch
> Patch a file (or files) with a diff file. Note that diff files should be
> generated by the `diff` command. More information: https://manned.org/patch.
* Apply a patch using a diff file (filenames must be included in the diff file):
`patch < {{patch.diff}}`
* Apply a patch to a specific file:
`patch {{path/to/file}} < {{patch.diff}}`
* Patch a file writing the result to a different file:
`patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}`
* Apply a patch to the current directory:
`patch -p1 < {{patch.diff}}`
* Apply the reverse of a patch:
`patch -R < {{patch.diff}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | delta | # delta
> A viewer for Git and diff output. More information:
> https://github.com/dandavison/delta.
* Compare files or directories:
`delta {{path/to/old_file_or_directory}} {{path/to/new_file_or_directory}}`
* Compare files or directories, showing the line numbers:
`delta --line-numbers {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Compare files or directories, showing the differences side by side:
`delta --side-by-side {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Compare files or directories, ignoring any Git configuration settings:
`delta --no-gitconfig {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Compare, rendering commit hashes, file names, and line numbers as hyperlinks, according to the hyperlink spec for terminal emulators:
`delta --hyperlinks {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Display the current settings:
`delta --show-config`
* Display supported languages and associated file extensions:
`delta --list-languages` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | touch | # touch
> Create files and set access/modification times. More information:
> https://manned.org/man/freebsd-13.1/touch.
* Create specific files:
`touch {{path/to/file1 path/to/file2 ...}}`
* Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist:
`touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}`
* Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist:
`touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}`
* Set the file time of a specific file to the time of anothe[r] file and don't [c]reate file if it doesn't exist:
`touch -c -r {{~/.emacs}} {{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. | nohup | # 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}} &` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | touch | # touch
> Create files and set access/modification times. More information:
> https://manned.org/man/freebsd-13.1/touch.
* Create specific files:
`touch {{path/to/file1 path/to/file2 ...}}`
* Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist:
`touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}`
* Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist:
`touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}`
* Set the file time of a specific file to the time of anothe[r] file and don't [c]reate file if it doesn't exist:
`touch -c -r {{~/.emacs}} {{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. | 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. | fuser | # fuser
> Display process IDs currently using files or sockets. More information:
> https://manned.org/fuser.
* Find which processes are accessing a file or directory:
`fuser {{path/to/file_or_directory}}`
* Show more fields (`USER`, `PID`, `ACCESS` and `COMMAND`):
`fuser --verbose {{path/to/file_or_directory}}`
* Identify processes using a TCP socket:
`fuser --namespace tcp {{port}}`
* Kill all processes accessing a file or directory (sends the `SIGKILL` signal):
`fuser --kill {{path/to/file_or_directory}}`
* Find which processes are accessing the filesystem containing a specific file or directory:
`fuser --mount {{path/to/file_or_directory}}`
* Kill all processes with a TCP connection on a specific port:
`fuser --kill {{port}}/tcp` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | flock | # flock
> Manage locks from shell scripts. It can be used to ensure that only one
> process of a command is running. More information: https://manned.org/flock.
* Run a command with a file lock as soon as the lock is not required by others:
`flock {{path/to/lock.lock}} --command "{{command}}"`
* Run a command with a file lock, and exit if the lock doesn't exist:
`flock {{path/to/lock.lock}} --nonblock --command "{{command}}"`
* Run a command with a file lock, and exit with a specific error code if the lock doesn't exist:
`flock {{path/to/lock.lock}} --nonblock --conflict-exit-code {{error_code}} -c
"{{command}}"` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | patch | # patch
> Patch a file (or files) with a diff file. Note that diff files should be
> generated by the `diff` command. More information: https://manned.org/patch.
* Apply a patch using a diff file (filenames must be included in the diff file):
`patch < {{patch.diff}}`
* Apply a patch to a specific file:
`patch {{path/to/file}} < {{patch.diff}}`
* Patch a file writing the result to a different file:
`patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}`
* Apply a patch to the current directory:
`patch -p1 < {{patch.diff}}`
* Apply the reverse of a patch:
`patch -R < {{patch.diff}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | paste | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | umask | # umask
> Manage the read/write/execute permissions that are masked out (i.e.
> restricted) for newly created files by the user. More information:
> https://manned.org/umask.
* Display the current mask in octal notation:
`umask`
* Display the current mask in symbolic (human-readable) mode:
`umask -S`
* Change the mask symbolically to allow read permission for all users (the rest of the mask bits are unchanged):
`umask {{a+r}}`
* Set the mask (using octal) to restrict no permissions for the file's owner, and restrict all permissions for everyone else:
`umask {{077}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | groff | # groff
> GNU replacement for the `troff` and `nroff` typesetting utilities. More
> information: https://www.gnu.org/software/groff.
* Format output for a PostScript printer, saving the output to a file:
`groff {{path/to/input.roff}} > {{path/to/output.ps}}`
* Render a man page using the ASCII output device, and display it using a pager:
`groff -man -T ascii {{path/to/manpage.1}} | less --RAW-CONTROL-CHARS`
* Render a man page into an HTML file:
`groff -man -T html {{path/to/manpage.1}} > {{path/to/manpage.html}}`
* Typeset a roff file containing [t]ables and [p]ictures, using the [me] macro set, to PDF, saving the output:
`groff {{-t}} {{-p}} -{{me}} -T {{pdf}} {{path/to/input.me}} >
{{path/to/output.pdf}}`
* Run a `groff` command with preprocessor and macro options guessed by the `grog` utility:
`eval "$(grog -T utf8 {{path/to/input.me}})"` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | rmdir | # rmdir
> Remove directories without files. See also: `rm`. More information:
> https://www.gnu.org/software/coreutils/rmdir.
* Remove specific directories:
`rmdir {{path/to/directory1 path/to/directory2 ...}}`
* Remove specific nested directories recursively:
`rmdir -p {{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. | 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. | login | # login
> Initiates a session for a user. More information: https://manned.org/login.
* Log in as a user:
`login {{user}}`
* Log in as user without authentication if user is preauthenticated:
`login -f {{user}}`
* Log in as user and preserve environment:
`login -p {{user}}`
* Log in as a user on a remote host:
`login -h {{host}} {{user}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | strip | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | pidof | # 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}})` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | egrep | # egrep
> Find patterns in files using extended regular expression (supports `?`, `+`,
> `{}`, `()` and `|`). More information: https://manned.org/egrep.
* Search for a pattern within a file:
`egrep "{{search_pattern}}" {{path/to/file}}`
* Search for a pattern within multiple files:
`egrep "{{search_pattern}}" {{path/to/file1}} {{path/to/file2}}
{{path/to/file3}}`
* Search `stdin` for a pattern:
`cat {{path/to/file}} | egrep {{search_pattern}}`
* Print file name and line number for each match:
`egrep --with-filename --line-number "{{search_pattern}}" {{path/to/file}}`
* Search for a pattern in all files recursively in a directory, ignoring binary files:
`egrep --recursive --binary-files={{without-match}} "{{search_pattern}}"
{{path/to/directory}}`
* Search for lines that do not match a pattern:
`egrep --invert-match "{{search_pattern}}" {{path/to/file}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | fgrep | # fgrep
> Matches fixed strings in files. Equivalent to `grep -F`. More information:
> https://www.gnu.org/software/grep/manual/grep.html.
* Search for an exact string in a file:
`fgrep {{search_string}} {{path/to/file}}`
* Search only lines that match entirely in files:
`fgrep -x {{path/to/file1}} {{path/to/file2}}`
* Count the number of lines that match the given string in a file:
`fgrep -c {{search_string}} {{path/to/file}}`
* Show the line number in the file along with the line matched:
`fgrep -n {{search_string}} {{path/to/file}}`
* Display all lines except those that contain the search string:
`fgrep -v {{search_string}} {{path/to/file}}`
* Display filenames whose content matches the search string at least once:
`fgrep -l {{search_string}} {{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. | chown | # chown
> Change user and group ownership of files and directories. More information:
> https://www.gnu.org/software/coreutils/chown.
* Change the owner user of a file/directory:
`chown {{user}} {{path/to/file_or_directory}}`
* Change the owner user and group of a file/directory:
`chown {{user}}:{{group}} {{path/to/file_or_directory}}`
* Recursively change the owner of a directory and its contents:
`chown -R {{user}} {{path/to/directory}}`
* Change the owner of a symbolic link:
`chown -h {{user}} {{path/to/symlink}}`
* Change the owner of a file/directory to match a reference file:
`chown --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. | pgrep | # pgrep
> Find or signal processes by name. More information:
> https://www.man7.org/linux/man-pages/man1/pkill.1.html.
* Return PIDs of any running processes with a matching command string:
`pgrep {{process_name}}`
* Search for processes including their command-line options:
`pgrep --full "{{process_name}} {{parameter}}"`
* Search for processes run by a specific user:
`pgrep --euid root {{process_name}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | nohup | # 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}} &` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | quilt | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | xargs | # xargs
> Execute a command with piped arguments coming from another command, a file,
> etc. The input is treated as a single block of text and split into separate
> pieces on spaces, tabs, newlines and end-of-file. More information:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html.
* Run a command using the input data as arguments:
`{{arguments_source}} | xargs {{command}}`
* Run multiple chained commands on the input data:
`{{arguments_source}} | xargs sh -c "{{command1}} && {{command2}} |
{{command3}}"`
* Delete all files with a `.backup` extension (`-print0` uses a null character to split file names, and `-0` uses it as delimiter):
`find . -name {{'*.backup'}} -print0 | xargs -0 rm -v`
* Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line:
`{{arguments_source}} | xargs -I _ {{command}} _ {{optional_extra_arguments}}`
* Parallel runs of up to `max-procs` processes at a time; the default is 1. If `max-procs` is 0, xargs will run as many processes as possible at a time:
`{{arguments_source}} | xargs -P {{max-procs}} {{command}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | namei | # namei
> Follows a pathname (which can be a symbolic link) until a terminal point is
> found (a file/directory/char device etc). This program is useful for finding
> "too many levels of symbolic links" problems. More information:
> https://manned.org/namei.
* Resolve the pathnames specified as the argument parameters:
`namei {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Display the results in a long-listing format:
`namei --long {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Show the mode bits of each file type in the style of `ls`:
`namei --modes {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Show owner and group name of each file:
`namei --owners {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Don't follow symlinks while resolving:
`namei --nosymlinks {{path/to/a}} {{path/to/b}} {{path/to/c}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | shred | # shred
> Overwrite files to securely delete data. More information:
> https://www.gnu.org/software/coreutils/shred.
* Overwrite a file:
`shred {{path/to/file}}`
* Overwrite a file, leaving zeroes instead of random data:
`shred --zero {{path/to/file}}`
* Overwrite a file 25 times:
`shred -n25 {{path/to/file}}`
* Overwrite a file and remove it:
`shred --remove {{path/to/file}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | write | # write
> Write a message on the terminal of a specified logged in user (ctrl-C to
> stop writing messages). Use the `who` command to find out all terminal_ids
> of all active users active on the system. See also `mesg`. More information:
> https://manned.org/write.
* Send a message to a given user on a given terminal id:
`write {{username}} {{terminal_id}}`
* Send message to "testuser" on terminal `/dev/tty/5`:
`write {{testuser}} {{tty/5}}`
* Send message to "johndoe" on pseudo terminal `/dev/pts/5`:
`write {{johndoe}} {{pts/5}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | chmod | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | xargs | # xargs
> Execute a command with piped arguments coming from another command, a file,
> etc. The input is treated as a single block of text and split into separate
> pieces on spaces, tabs, newlines and end-of-file. More information:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html.
* Run a command using the input data as arguments:
`{{arguments_source}} | xargs {{command}}`
* Run multiple chained commands on the input data:
`{{arguments_source}} | xargs sh -c "{{command1}} && {{command2}} |
{{command3}}"`
* Delete all files with a `.backup` extension (`-print0` uses a null character to split file names, and `-0` uses it as delimiter):
`find . -name {{'*.backup'}} -print0 | xargs -0 rm -v`
* Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line:
`{{arguments_source}} | xargs -I _ {{command}} _ {{optional_extra_arguments}}`
* Parallel runs of up to `max-procs` processes at a time; the default is 1. If `max-procs` is 0, xargs will run as many processes as possible at a time:
`{{arguments_source}} | xargs -P {{max-procs}} {{command}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | chown | # chown
> Change user and group ownership of files and directories. More information:
> https://www.gnu.org/software/coreutils/chown.
* Change the owner user of a file/directory:
`chown {{user}} {{path/to/file_or_directory}}`
* Change the owner user and group of a file/directory:
`chown {{user}}:{{group}} {{path/to/file_or_directory}}`
* Recursively change the owner of a directory and its contents:
`chown -R {{user}} {{path/to/directory}}`
* Change the owner of a symbolic link:
`chown -h {{user}} {{path/to/symlink}}`
* Change the owner of a file/directory to match a reference file:
`chown --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. | sshfs | # sshfs
> Filesystem client based on SSH. More information:
> https://github.com/libfuse/sshfs.
* Mount remote directory:
`sshfs {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}`
* Unmount remote directory:
`umount {{mountpoint}}`
* Mount remote directory from server with specific port:
`sshfs {{username}}@{{remote_host}}:{{remote_directory}} -p {{2222}}`
* Use compression:
`sshfs {{username}}@{{remote_host}}:{{remote_directory}} -C`
* Follow symbolic links:
`sshfs -o follow_symlinks {{username}}@{{remote_host}}:{{remote_directory}}
{{mountpoint}}` |
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. | write | # write
> Write a message on the terminal of a specified logged in user (ctrl-C to
> stop writing messages). Use the `who` command to find out all terminal_ids
> of all active users active on the system. See also `mesg`. More information:
> https://manned.org/write.
* Send a message to a given user on a given terminal id:
`write {{username}} {{terminal_id}}`
* Send message to "testuser" on terminal `/dev/tty/5`:
`write {{testuser}} {{tty/5}}`
* Send message to "johndoe" on pseudo terminal `/dev/pts/5`:
`write {{johndoe}} {{pts/5}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | quota | # quota
> Display users' disk space usage and allocated limits. More information:
> https://manned.org/quota.
* Show disk quotas in human-readable units for the current user:
`quota -s`
* Verbose output (also display quotas on filesystems where no storage is allocated):
`quota -v`
* Quiet output (only display quotas on filesystems where usage is over quota):
`quota -q`
* Print quotas for the groups of which the current user is a member:
`quota -g`
* Show disk quotas for another user:
`sudo quota -u {{username}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | chmod | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | rmdir | # rmdir
> Remove directories without files. See also: `rm`. More information:
> https://www.gnu.org/software/coreutils/rmdir.
* Remove specific directories:
`rmdir {{path/to/directory1 path/to/directory2 ...}}`
* Remove specific nested directories recursively:
`rmdir -p {{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. | tsort | # tsort
> Perform a topological sort. A common use is to show the dependency order of
> nodes in a directed acyclic graph. More information:
> https://www.gnu.org/software/coreutils/tsort.
* Perform a topological sort consistent with a partial sort per line of input separated by blanks:
`tsort {{path/to/file}}`
* Perform a topological sort consistent on strings:
`echo -e "{{UI Backend\nBackend Database\nDocs UI}}" | tsort` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | split | # split
> Split a file into pieces. More information: https://ss64.com/osx/split.html.
* Split a file, each split having 10 lines (except the last split):
`split -l {{10}} {{filename}}`
* Split a file by a regular expression. The matching line will be the first line of the next output file:
`split -p {{cat|^[dh]og}} {{filename}}`
* Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):
`split -b {{512}} {{filename}}`
* Split a file into 5 files. File is split such that each split has same size (except the last split):
`split -n {{5}} {{filename}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | mailx | # mailx
> Send and receive mail. More information: https://manned.org/mailx.
* Send mail (the content should be typed after the command, and ended with `Ctrl+D`):
`mailx -s "{{subject}}" {{to_addr}}`
* Send mail with content passed from another command:
`echo "{{content}}" | mailx -s "{{subject}}" {{to_addr}}`
* Send mail with content read from a file:
`mailx -s "{{subject}}" {{to_addr}} < {{content.txt}}`
* Send mail to a recipient and CC to another address:
`mailx -s "{{subject}}" -c {{cc_addr}} {{to_addr}}`
* Send mail specifying the sender address:
`mailx -s "{{subject}}" -r {{from_addr}} {{to_addr}}`
* Send mail with an attachment:
`mailx -a {{path/to/file}} -s "{{subject}}" {{to_addr}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | pkill | # pkill
> Signal process by name. Mostly used for stopping processes. More
> information: https://www.man7.org/linux/man-pages/man1/pkill.1.html.
* Kill all processes which match:
`pkill "{{process_name}}"`
* Kill all processes which match their full command instead of just the process name:
`pkill -f "{{command_name}}"`
* Force kill matching processes (can't be blocked):
`pkill -9 "{{process_name}}"`
* Send SIGUSR1 signal to processes which match:
`pkill -USR1 "{{process_name}}"`
* Kill the main `firefox` process to close the browser:
`pkill --oldest "{{firefox}}"` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | paste | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | strip | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | colrm | # colrm
> Remove columns from `stdin`. More information: https://manned.org/colrm.
* Remove first column of `stdin`:
`colrm {{1 1}}`
* Remove from 3rd column till the end of each line:
`colrm {{3}}`
* Remove from the 3rd column till the 5th column of each line:
`colrm {{3 5}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | diff3 | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | b2sum | # b2sum
> Calculate BLAKE2 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/b2sum.
* Calculate the BLAKE2 checksum for one or more files:
`b2sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of BLAKE2 checksums to a file:
`b2sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.b2}}`
* Calculate a BLAKE2 checksum from `stdin`:
`{{command}} | b2sum`
* Read a file of BLAKE2 sums and filenames and verify all files have matching checksums:
`b2sum --check {{path/to/file.b2}}`
* Only show a message for missing files or when verification fails:
`b2sum --check --quiet {{path/to/file.b2}}`
* Only show a message when verification fails, ignoring missing files:
`b2sum --ignore-missing --check --quiet {{path/to/file.b2}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | login | # login
> Initiates a session for a user. More information: https://manned.org/login.
* Log in as a user:
`login {{user}}`
* Log in as user without authentication if user is preauthenticated:
`login -f {{user}}`
* Log in as user and preserve environment:
`login -p {{user}}`
* Log in as a user on a remote host:
`login -h {{host}} {{user}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | cksum | # cksum
> Calculates CRC checksums and byte counts of a file. Note, on old UNIX
> systems the CRC implementation may differ. More information:
> https://www.gnu.org/software/coreutils/cksum.
* Display a 32-bit checksum, size in bytes and filename:
`cksum {{path/to/file}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | clear | # clear
> Clears the screen of the terminal. More information:
> https://manned.org/clear.
* Clear the screen (equivalent to pressing Control-L in Bash shell):
`clear`
* Clear the screen but keep the terminal's scrollback buffer:
`clear -x`
* Indicate the type of terminal to clean (defaults to the value of the environment variable `TERM`):
`clear -T {{type_of_terminal}}`
* Show the version of `ncurses` used by `clear`:
`clear -V` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | newgrp | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | renice | # renice
> Alters the scheduling priority/niceness of one or more running processes.
> Niceness values range from -20 (most favorable to the process) to 19 (least
> favorable to the process). More information: https://manned.org/renice.
* Change priority of a running process:
`renice -n {{niceness_value}} -p {{pid}}`
* Change priority of all processes owned by a user:
`renice -n {{niceness_value}} -u {{user}}`
* Change priority of all processes that belong to a process group:
`renice -n {{niceness_value}} --pgrp {{process_group}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | keyctl | # keyctl
> Manipulate the Linux kernel keyring. More information:
> https://manned.org/keyctl.
* List keys in a specific keyring:
`keyctl list {{target_keyring}}`
* List current keys in the user default session:
`keyctl list {{@us}}`
* Store a key in a specific keyring:
`keyctl add {{type_keyring}} {{key_name}} {{key_value}} {{target_keyring}}`
* Store a key with its value from `stdin`:
`echo -n {{key_value}} | keyctl padd {{type_keyring}} {{key_name}}
{{target_keyring}}`
* Put a timeout on a key:
`keyctl timeout {{key_name}} {{timeout_in_seconds}}`
* Read a key and format it as a hex-dump if not printable:
`keyctl read {{key_name}}`
* Read a key and format as-is:
`keyctl pipe {{key_name}}`
* Revoke a key and prevent any further action on it:
`keyctl revoke {{key_name}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | unlink | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | getopt | # getopt
> Parse command-line arguments. More information:
> https://www.gnu.org/software/libc/manual/html_node/Getopt.html.
* Parse optional `verbose`/`version` flags with shorthands:
`getopt --options vV --longoptions verbose,version -- --version --verbose`
* Add a `--file` option with a required argument with shorthand `-f`:
`getopt --options f: --longoptions file: -- --file=somefile`
* Add a `--verbose` option with an optional argument with shorthand `-v`, and pass a non-option parameter `arg`:
`getopt --options v:: --longoptions verbose:: -- --verbose arg`
* Accept a `-r` and `--verbose` flag, a `--accept` option with an optional argument and add a `--target` with a required argument option with shorthands:
`getopt --options rv::s::t: --longoptions verbose,source::,target: -- -v
--target target` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | lpstat | # lpstat
> Display status information about the current classes, jobs, and printers.
> More information: https://ss64.com/osx/lpstat.html.
* Show a long listing of printers, classes, and jobs:
`lpstat -l`
* Force encryption when connecting to the CUPS server:
`lpstat -E`
* Show the ranking of print jobs:
`lpstat -R`
* Show whether or not the CUPS server is running:
`lpstat -r`
* Show all status information:
`lpstat -t` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | basenc | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | pstree | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | groups | # groups
> Print group memberships for a user. See also: `groupadd`, `groupdel`,
> `groupmod`. More information: https://www.gnu.org/software/coreutils/groups.
* Print group memberships for the current user:
`groups`
* Print group memberships for a list of users:
`groups {{username1 username2 ...}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | chattr | # chattr
> Change attributes of files or directories. More information:
> https://manned.org/chattr.
* Make a file or directory immutable to changes and deletion, even by superuser:
`chattr +i {{path/to/file_or_directory}}`
* Make a file or directory mutable:
`chattr -i {{path/to/file_or_directory}}`
* Recursively make an entire directory and contents immutable:
`chattr -R +i {{path/to/directory}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | locale | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | unlink | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | whatis | # whatis
> Tool that searches a set of database files containing short descriptions of
> system commands for keywords. More information:
> http://www.linfo.org/whatis.html.
* Search for information about keyword:
`whatis {{keyword}}`
* Search for information about multiple keywords:
`whatis {{keyword1}} {{keyword2}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | base32 | # base32
> Encode or decode file or `stdin` to/from Base32, to `stdout`. More
> information: https://www.gnu.org/software/coreutils/base32.
* Encode a file:
`base32 {{path/to/file}}`
* Decode a file:
`base32 --decode {{path/to/file}}`
* Encode from `stdin`:
`{{somecommand}} | base32`
* Decode from `stdin`:
`{{somecommand}} | base32 --decode` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | csplit | # csplit
> Split a file into pieces. This generates files named "xx00", "xx01", and so
> on. More information: https://www.gnu.org/software/coreutils/csplit.
* Split a file at lines 5 and 23:
`csplit {{path/to/file}} {{5}} {{23}}`
* Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5):
`csplit {{path/to/file}} {{5}} {*}`
* Split a file every 5 lines, ignoring exact-division error:
`csplit -k {{path/to/file}} {{5}} {*}`
* Split a file at line 5 and use a custom prefix for the output files:
`csplit {{path/to/file}} {{5}} -f {{prefix}}`
* Split a file at a line matching a regular expression:
`csplit {{path/to/file}} /{{regular_expression}}/` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | chroot | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | git-mv | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | runcon | # runcon
> Run a program in a different SELinux security context. With neither context
> nor command, print the current security context. More information:
> https://www.gnu.org/software/coreutils/runcon.
* Determine the current domain:
`runcon`
* Specify the domain to run a command in:
`runcon -t {{domain}}_t {{command}}`
* Specify the context role to run a command with:
`runcon -r {{role}}_r {{command}}`
* Specify the full context to run a command with:
`runcon {{user}}_u:{{role}}_r:{{domain}}_t {{command}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | csplit | # csplit
> Split a file into pieces. This generates files named "xx00", "xx01", and so
> on. More information: https://www.gnu.org/software/coreutils/csplit.
* Split a file at lines 5 and 23:
`csplit {{path/to/file}} {{5}} {{23}}`
* Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5):
`csplit {{path/to/file}} {{5}} {*}`
* Split a file every 5 lines, ignoring exact-division error:
`csplit -k {{path/to/file}} {{5}} {*}`
* Split a file at line 5 and use a custom prefix for the output files:
`csplit {{path/to/file}} {{5}} -f {{prefix}}`
* Split a file at a line matching a regular expression:
`csplit {{path/to/file}} /{{regular_expression}}/` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | indent | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | column | # column
> Format `stdin` or a file into multiple columns. Columns are filled before
> rows; the default separator is a whitespace. More information:
> https://manned.org/column.
* Format the output of a command for a 30 characters wide display:
`printf "header1 header2\nbar foo\n" | column --output-width {{30}}`
* Split columns automatically and auto-align them in a tabular format:
`printf "header1 header2\nbar foo\n" | column --table`
* Specify the column delimiter character for the `--table` option (e.g. "," for CSV) (defaults to whitespace):
`printf "header1,header2\nbar,foo\n" | column --table --separator {{,}}`
* Fill rows before filling columns:
`printf "header1\nbar\nfoobar\n" | column --output-width {{30}} --fillrows` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | busctl | # busctl
> Introspect and monitor the D-Bus bus. More information:
> https://www.freedesktop.org/software/systemd/man/busctl.html.
* Show all peers on the bus, by their service names:
`busctl list`
* Show process information and credentials of a bus service, a process, or the owner of the bus (if no parameter is specified):
`busctl status {{service|pid}}`
* Dump messages being exchanged. If no service is specified, show all messages on the bus:
`busctl monitor {{service1 service2 ...}}`
* Show an object tree of one or more services (or all services if no service is specified):
`busctl tree {{service1 service2 ...}}`
* Show interfaces, methods, properties and signals of the specified object on the specified service:
`busctl introspect {{service}} {{path/to/object}}`
* Retrieve the current value of one or more object properties:
`busctl get-property {{service}} {{path/to/object}} {{interface_name}}
{{property_name}}`
* Invoke a method and show the response:
`busctl call {{service}} {{path/to/object}} {{interface_name}}
{{method_name}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | renice | # renice
> Alters the scheduling priority/niceness of one or more running processes.
> Niceness values range from -20 (most favorable to the process) to 19 (least
> favorable to the process). More information: https://manned.org/renice.
* Change priority of a running process:
`renice -n {{niceness_value}} -p {{pid}}`
* Change priority of all processes owned by a user:
`renice -n {{niceness_value}} -u {{user}}`
* Change priority of all processes that belong to a process group:
`renice -n {{niceness_value}} --pgrp {{process_group}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | screen | # screen
> Hold a session open on a remote server. Manage multiple windows with a
> single SSH connection. See also `tmux` and `zellij`. More information:
> https://manned.org/screen.
* Start a new screen session:
`screen`
* Start a new named screen session:
`screen -S {{session_name}}`
* Start a new daemon and log the output to `screenlog.x`:
`screen -dmLS {{session_name}} {{command}}`
* Show open screen sessions:
`screen -ls`
* Reattach to an open screen:
`screen -r {{session_name}}`
* Detach from inside a screen:
`Ctrl + A, D`
* Kill the current screen session:
`Ctrl + A, K`
* Kill a detached screen:
`screen -X -S {{session_name}} quit` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | logger | # logger
> Add messages to syslog (/var/log/syslog). More information:
> https://manned.org/logger.
* Log a message to syslog:
`logger {{message}}`
* Take input from `stdin` and log to syslog:
`echo {{log_entry}} | logger`
* Send the output to a remote syslog server running at a given port. Default port is 514:
`echo {{log_entry}} | logger --server {{hostname}} --port {{port}}`
* Use a specific tag for every line logged. Default is the name of logged in user:
`echo {{log_entry}} | logger --tag {{tag}}`
* Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options:
`echo {{log_entry}} | logger --priority {{user.warning}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | mktemp | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | logger | # logger
> Add messages to syslog (/var/log/syslog). More information:
> https://manned.org/logger.
* Log a message to syslog:
`logger {{message}}`
* Take input from `stdin` and log to syslog:
`echo {{log_entry}} | logger`
* Send the output to a remote syslog server running at a given port. Default port is 514:
`echo {{log_entry}} | logger --server {{hostname}} --port {{port}}`
* Use a specific tag for every line logged. Default is the name of logged in user:
`echo {{log_entry}} | logger --tag {{tag}}`
* Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options:
`echo {{log_entry}} | logger --priority {{user.warning}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | uptime | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | mkfifo | # mkfifo
> Makes FIFOs (named pipes). More information:
> https://www.gnu.org/software/coreutils/mkfifo.
* Create a named pipe at a given path:
`mkfifo {{path/to/pipe}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | md5sum | # md5sum
> Calculate MD5 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/md5sum.
* Calculate the MD5 checksum for one or more files:
`md5sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of MD5 checksums to a file:
`md5sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.md5}}`
* Calculate an MD5 checksum from `stdin`:
`{{command}} | md5sum`
* Read a file of MD5 sums and filenames and verify all files have matching checksums:
`md5sum --check {{path/to/file.md5}}`
* Only show a message for missing files or when verification fails:
`md5sum --check --quiet {{path/to/file.md5}}`
* Only show a message when verification fails, ignoring missing files:
`md5sum --ignore-missing --check --quiet {{path/to/file.md5}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | mpstat | # mpstat
> Report CPU statistics. More information: https://manned.org/mpstat.
* Display CPU statistics every 2 seconds:
`mpstat {{2}}`
* Display 5 reports, one by one, at 2 second intervals:
`mpstat {{2}} {{5}}`
* Display 5 reports, one by one, from a given processor, at 2 second intervals:
`mpstat -P {{0}} {{2}} {{5}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | lsattr | # lsattr
> List file attributes on a Linux filesystem. More information:
> https://manned.org/lsattr.
* Display the attributes of the files in the current directory:
`lsattr`
* List the attributes of files in a particular path:
`lsattr {{path}}`
* List file attributes recursively in the current and subsequent directories:
`lsattr -R`
* Show attributes of all the files in the current directory, including hidden ones:
`lsattr -a`
* Display attributes of directories in the current directory:
`lsattr -d` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | git-am | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | expand | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | printf | # printf
> Format and print text. More information:
> https://www.gnu.org/software/coreutils/printf.
* Print a text message:
`printf "{{%s\n}}" "{{Hello world}}"`
* Print an integer in bold blue:
`printf "{{\e[1;34m%.3d\e[0m\n}}" {{42}}`
* Print a float number with the Unicode Euro sign:
`printf "{{\u20AC %.2f\n}}" {{123.4}}`
* Print a text message composed with environment variables:
`printf "{{var1: %s\tvar2: %s\n}}" "{{$VAR1}}" "{{$VAR2}}"`
* Store a formatted message in a variable (does not work on zsh):
`printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | base64 | # base64
> Encode and decode using Base64 representation. More information:
> https://www.unix.com/man-page/osx/1/base64/.
* Encode a file:
`base64 --input={{plain_file}}`
* Decode a file:
`base64 --decode --input={{base64_file}}`
* Encode from `stdin`:
`echo -n "{{plain_text}}" | base64`
* Decode from `stdin`:
`echo -n {{base64_text}} | base64 --decode` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | script | # script
> Make a typescript file of a terminal session. More information:
> https://manned.org/script.
* Start recording in file named "typescript":
`script`
* Stop recording:
`exit`
* Start recording in a given file:
`script {{logfile.log}}`
* Append to an existing file:
`script -a {{logfile.log}}`
* Execute quietly without start and done messages:
`script -q {{logfile.log}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | ltrace | # ltrace
> Display dynamic library calls of a process. More information:
> https://manned.org/ltrace.
* Print (trace) library calls of a program binary:
`ltrace ./{{program}}`
* Count library calls. Print a handy summary at the bottom:
`ltrace -c {{path/to/program}}`
* Trace calls to malloc and free, omit those done by libc:
`ltrace -e malloc+free-@libc.so* {{path/to/program}}`
* Write to file instead of terminal:
`ltrace -o {{file}} {{path/to/program}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | whoami | # whoami
> Print the username associated with the current effective user ID. More
> information: https://www.gnu.org/software/coreutils/whoami.
* Display currently logged username:
`whoami`
* Display the username after a change in the user ID:
`sudo whoami` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | git-gc | # git gc
> Optimise the local repository by cleaning unnecessary files. More
> information: https://git-scm.com/docs/git-gc.
* Optimise the repository:
`git gc`
* Aggressively optimise, takes more time:
`git gc --aggressive`
* Do not prune loose objects (prunes by default):
`git gc --no-prune`
* Suppress all output:
`git gc --quiet`
* View full usage:
`git gc --help` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | ulimit | # ulimit
> Get and set user limits. More information: https://manned.org/ulimit.
* Get the properties of all the user limits:
`ulimit -a`
* Get hard limit for the number of simultaneously opened files:
`ulimit -H -n`
* Get soft limit for the number of simultaneously opened files:
`ulimit -S -n`
* Set max per-user process limit:
`ulimit -u 30` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | iostat | # iostat
> Report statistics for devices and partitions. More information:
> https://manned.org/iostat.
* Display a report of CPU and disk statistics since system startup:
`iostat`
* Display a report of CPU and disk statistics with units converted to megabytes:
`iostat -m`
* Display CPU statistics:
`iostat -c`
* Display disk statistics with disk names (including LVM):
`iostat -N`
* Display extended disk statistics with disk names for device "sda":
`iostat -xN {{sda}}`
* Display incremental reports of CPU and disk statistics every 2 seconds:
`iostat {{2}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | expand | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | printf | # printf
> Format and print text. More information:
> https://www.gnu.org/software/coreutils/printf.
* Print a text message:
`printf "{{%s\n}}" "{{Hello world}}"`
* Print an integer in bold blue:
`printf "{{\e[1;34m%.3d\e[0m\n}}" {{42}}`
* Print a float number with the Unicode Euro sign:
`printf "{{\u20AC %.2f\n}}" {{123.4}}`
* Print a text message composed with environment variables:
`printf "{{var1: %s\tvar2: %s\n}}" "{{$VAR1}}" "{{$VAR2}}"`
* Store a formatted message in a variable (does not work on zsh):
`printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | expect | # expect
> Script executor that interacts with other programs that require user input.
> More information: https://manned.org/expect.
* Execute an expect script from a file:
`expect {{path/to/file}}`
* Execute a specified expect script:
`expect -c "{{commands}}"`
* Enter an interactive REPL (use `exit` or Ctrl + D to exit):
`expect -i` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | groups | # groups
> Print group memberships for a user. See also: `groupadd`, `groupdel`,
> `groupmod`. More information: https://www.gnu.org/software/coreutils/groups.
* Print group memberships for the current user:
`groups`
* Print group memberships for a list of users:
`groups {{username1 username2 ...}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | uptime | # 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` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | git-rm | # git rm
> Remove files from repository index and local filesystem. More information:
> https://git-scm.com/docs/git-rm.
* Remove file from repository index and filesystem:
`git rm {{path/to/file}}`
* Remove directory:
`git rm -r {{path/to/directory}}`
* Remove file from repository index but keep it untouched locally:
`git rm --cached {{path/to/file}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | getent | # 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}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | mkfifo | # mkfifo
> Makes FIFOs (named pipes). More information:
> https://www.gnu.org/software/coreutils/mkfifo.
* Create a named pipe at a given path:
`mkfifo {{path/to/pipe}}` |
You are a linux expert. You understand what every Linux terminal command does and you reply with the explanation when asked. | passwd | # 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` |
Subsets and Splits