diff --git a/tldr/linux/dnf b/tldr/linux/dnf index 3ceaf5f6..7f8d8fdc 100644 --- a/tldr/linux/dnf +++ b/tldr/linux/dnf @@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # dnf > Package management utility for RHEL, Fedora, and CentOS (replaces yum). +> Some subcommands such as `group` and `config-manager` have their own usage documentation. > For equivalent commands in other package managers, see . > More information: . diff --git a/tldr/linux/dnf-group b/tldr/linux/dnf-group new file mode 100644 index 00000000..78761d59 --- /dev/null +++ b/tldr/linux/dnf-group @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# dnf group + +> Manage virtual collections of packages on Fedora-based systems. +> More information: . + +- List DNF groups, showing installed and uninstalled status in a table: + +`dnf group list` + +- Show DNF group info, including repository and optional packages: + +`dnf group info {{group_name}}` + +- Install DNF group: + +`dnf group install {{group_name}}` + +- Remove DNF group: + +`dnf group remove {{group_name}}` + +- Upgrade DNF group: + +`dnf group upgrade {{group_name}}` diff --git a/tldr/linux/dnf5-group b/tldr/linux/dnf5-group new file mode 100644 index 00000000..af8393c6 --- /dev/null +++ b/tldr/linux/dnf5-group @@ -0,0 +1,13 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# dnf5 group + +> This command is an alias of `dnf group`. +> Note: from Fedora 37 to 40 (inclusive), `dnf` runs DNF v4 while `dnf5` runs DNF v5. + +- View documentation for the original command: + +`tldr dnf group` diff --git a/tldr/linux/jobs b/tldr/linux/jobs index 20f4fc08..a52900ef 100644 --- a/tldr/linux/jobs +++ b/tldr/linux/jobs @@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git > Shell builtin for viewing information about processes spawned by the current shell. > Options other than `-l` and `-p` are exclusive to `bash`. -> More information: . +> More information: . - View jobs spawned by the current shell: diff --git a/tldr/pwd b/tldr/pwd index 95747205..55beceab 100644 --- a/tldr/pwd +++ b/tldr/pwd @@ -15,3 +15,7 @@ source: https://github.com/tldr-pages/tldr.git - Print the current directory, and resolve all symlinks (i.e. show the "physical" path): `pwd -P` + +- Print the current logical directory: + +`pwd -L` diff --git a/tldr/trdsql b/tldr/trdsql new file mode 100644 index 00000000..ca0f2f7f --- /dev/null +++ b/tldr/trdsql @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# trdsql + +> Execute SQL on CSV, LTSV, JSON, YAML, and TBLN files. +> More information: . + +- Convert object data from multiple JSON files to a CSV file with header (`-oh`) and double quote: + +`trdsql -ocsv -oh "SELECT * FROM {{path/to/file/*.json}}" | sed 's/\([^,]*\)/"&"/g' > {{path/to/file.csv}}` + +- Interpret JSON list as a table and put objects inside as columns (path/to/file.json: `{"list":[{"age":"26","name":"Tanaka"}]}`): + +`trdsql "SELECT * FROM {{path/to/file.json}}::.list` + +- Manipulate complex SQL query with data from multiple CSV files with first line is header (`-ih`): + +`trdsql -icsv -ih "SELECT {{column1,column2}} FROM {{path/to/file*.csv}} WHERE column2 != '' ORDER BY column1 GROUP BY column1"` + +- Merge content of 2 CSV files to one CSV file: + +`trdsql "SELECT {{column1,colum2}} FROM {{path/to/file1.csv}} UNION SELECT {{column1,column2}} FROM {{path/to/file2.csv}}"` + +- Connect to PostgreSQL database: + +`trdsql -driver postgres -dsn "host={{hostname}} port={{5433}} dbname={{database_name}}" "SELECT 1"` + +- Create table data to MySQL database from CSV file: + +`trdsql -driver mysql -dsn "{{username}}:{{password}}@{{hostname}}/{{database}}" -ih "CREATE TABLE {{table}} ({{column1}} int, {{colum2}} varchar(20)) AS SELECT {{column3}} AS {{column1}},{{column2}} FROM {{path/to/header_file.csv}}"` + +- Show data from compress log files: + +`trdsql -iltsv "SELECT * FROM {{path/to/access.log.gz}}"`