chunk@chunk-thinkpad-x240:~$ tldr tar
正克隆到 'tldr'...
remote: Enumerating objects: 50333, done.
remote: Counting objects: 100% (50/50), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 50333(delta 25), reused 2(delta 0), pack-reused 50283
接收对象中: 100% (50333/50333), 12.70 MiB |6.73 MiB/s, 完成.
处理 delta 中: 100% (31489/31489), 完成.
tar
Archiving utility.Often combined with a compression method, such as gzip or bzip2.More information: https://www.gnu.org/software/tar.
- [c]reate an archive and write it to a [f]ile:
tar cf {{target.tar}}{{file1}}{{file2}}{{file3}}
- [c]reate a g[z]ipped archive and write it to a [f]ile:
tar czf {{target.tar.gz}}{{file1}}{{file2}}{{file3}}
- [c]reate a g[z]ipped archive from a directory using relative paths:
tar czf {{target.tar.gz}} --directory={{path/to/directory}}.
- E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely:
tar xvf {{source.tar[.gz|.bz2|.xz]}}
- E[x]tract a (compressed) archive [f]ile into the target directory:
tar xf {{source.tar[.gz|.bz2|.xz]}} --directory={{directory}}
- [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program:
tar caf {{target.tar.xz}}{{file1}}{{file2}}{{file3}}
- Lis[t] the contents of a tar[f]ile [v]erbosely:
tar tvf {{source.tar}}
- E[x]tract files matching a pattern from an archive [f]ile:
tar xf {{source.tar}} --wildcards "{{*.html}}"
chunk@chunk-thinkpad-x240:~$ tldr mysql
mysql
The MySQL command-line tool.More information: https://www.mysql.com/.
- Connect to a database:
mysql {{database_name}}
- Connect to a database, user will be prompted for a password:
mysql -u {{user}} --password {{database_name}}
- Connect to a database on another host:
mysql -h {{database_host}}{{database_name}}
- Connect to a database through a Unix socket:
mysql --socket {{path/to/socket.sock}}
- Execute SQL statements in a script file(batch file):
mysql -e "source {{filename.sql}}"{{database_name}}
- Restore a database from a backup created with mysqldump (user will be prompted for a password):
mysql --user {{user}} --password {{database_name}}<{{path/to/backup.sql}}
- Restore all databases from a backup (user will be prompted for a password):
mysql --user {{user}} --password <{{path/to/backup.sql}}
chunk@chunk-thinkpad-x240:~$ tldr lsls
List directory contents.More information: https://www.gnu.org/software/coreutils/ls.
- List files one per line:
ls -1
- List all files, including hidden files:
ls -a
- List all files, with trailing / added to directory names:
ls -F
- Long format list (permissions, ownership, size, and modification date) of all files:
ls -la
- Long format list with size displayed using human readable units(KiB, MiB, GiB):
ls -lh
- Long format list sorted by size (descending):
ls -lS
- Long format list of all files, sorted by modification date(oldest first):
ls -ltr
- Only list directories:
ls -d {{*/}}
chunk@chunk-thinkpad-x240:~$ tldr -h
tldr - Simplified and community-driven man pages
Usage: tldr [-v|--version][--update] COMMAND
tldr Client program
Available options:
-h,--help Show this help text
-v,--version Show version
--update Update tldr pages
COMMAND name of the command