2023-12-07 04:04:03 +03:00
# Bash reference file.
To get help with usage info run:
```text
$ help < COMMAND >
or
$ h < COMMAND >
```
2023-12-07 05:11:26 +03:00
## Android.
Command|Description
---|---
2024-01-24 22:17:40 +03:00
`emulator [NAME]` |Start an Android emulator. Default name is `main` .
2023-12-07 05:11:26 +03:00
## Archive.
2023-12-07 04:04:03 +03:00
Command|Description
---|---
2024-01-03 17:21:11 +03:00
`archive [DIRS]` |Archive directories. All directories by default. Supports .archiveignore exclude file.
2024-01-09 01:36:46 +03:00
`archive_mt [DIRS]` |Archive using multiple threads. Uses 75% of free RAM. All directories by default. Supports .archiveignore exclude file.
2024-01-03 17:21:11 +03:00
`archive_fast [DIRS]` |Archive directories with fast compression. All directories by default. Supports .archiveignore exclude file.
2023-12-07 05:22:29 +03:00
`archive_check [FILES]` |Check archives integrity. Checks all archives by default.
2024-01-03 18:33:47 +03:00
`archive_prune [NAME] [VERSIONS]` |Delete old versions of an archive. All archives with 1 version by default.
2023-12-10 04:31:03 +03:00
`archive_rm [FILES]` |Delete specified or all archive files.
2023-12-17 21:15:50 +03:00
`archive_xz [FILES]` |Recompress previously created archive_fast with better compression.
`archive_name [ARCHIVE] [NAME]` |Rename archives. If no name specified, it simplifies archive's name. If no archives specified, apply to all archives.
`unarchive [FILES]` |Extract previously created archive with checksum validation.
2023-12-07 05:11:26 +03:00
## Battery.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`battery_level` |Print current battery level.
2023-12-07 05:11:26 +03:00
## Bootstrap.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`bootstrap_rust` |Install Cargo/Rust.
`bootstrap_texlive` |Install TeXLive.
`bootstrap_grub` |Install grub theme.
`bootstrap_ffmpeg` |Install ffmpeg.
2023-12-17 21:15:50 +03:00
`bootstrap_editorconfig` |Install Editorconfig file (with tabs) in current directory.
`bootstrap_editorconfig_space [AMOUNT]` |Install Editorconfig file (with specified spaces, 8 by default) in current directory.
2024-01-28 20:57:01 +03:00
`bootstrap_flatpak` |Setup all the flatpak apps on the machine.
2023-12-07 05:11:26 +03:00
## Cd.
Command|Description
---|---
2024-01-09 19:53:36 +03:00
`cdd <DIR>` |CD (back to) directory. Goes to the exact-match dir first. If no exact match found, it finds first directory that contains the input (case-insensitive).
2023-12-07 05:11:26 +03:00
## Checksum.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`checksum_create [FILES]` |Save file checksums. For file with a name `file` it will create a new file called `.file.sha1` with hash in it. All files by default.
`checksum_check [FILES]` |Check stored values against actual files. All files by default.
`checksum` |Calculate hashes for all files recursively and store in a file called `checksum.sha1` .
2023-12-07 05:11:26 +03:00
## Chmod.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`x <FILES>` |Add executable flag to file.
2023-12-07 05:11:26 +03:00
## Color.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`color_test` |Print all available colors with their names colored in corresponding color.
2023-12-07 05:11:26 +03:00
2024-01-25 16:13:21 +03:00
## Container.
Command|Description
---|---
`ca [NAME]` |Attach/create container box in current directory with specified name. Uses `main` name by default.
`ck [NAME]` |Remove container box with specified name. By default uses `main` name.
`cka` |Remove all container boxes.
`cl` |List all container boxes.
2023-12-07 05:11:26 +03:00
## Copypaste.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`copy` |Copy stdin to system clipboard. *Example:* `echo hi \| copy` .
`paste` |Paste system clipboard to stdout. *Example:* `paste > file.txt` .
2023-12-07 05:11:26 +03:00
## Cp.
Command|Description
---|---
2024-01-31 03:32:45 +03:00
`rcp <FROM> <TO>` |Replaces default cp with rsync.
`rcp_merge <FROM> <TO>` |Copy and also merge all changes (delete dst files that do not exist in src).
2023-12-07 05:22:29 +03:00
`cp_link <FROM> <TO>` |Copy by creating hardlinks. Works for directories, too.
2024-01-31 03:32:45 +03:00
`rcp_test <FROM> <TO>` |Print output of cp_merge without writing anything.
2023-12-07 05:11:26 +03:00
## Date.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`today` |Print today date in yyyyMMdd format.
`dow` |Current day of week number.
2023-12-07 05:11:26 +03:00
## Dconf.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`dconf_load` |Load Gnome settings.
`dconf_save [FILE]` |Dump Gnome settings into the file. Default name is `gnome.dconf` . Do this before changing settings and after, an then run `diff` to find out what to add to the main `gnome.dconf` .
2023-12-07 05:11:26 +03:00
2024-01-28 20:57:01 +03:00
## Disk.
Command|Description
---|---
2024-01-31 03:32:45 +03:00
`pdf` |Show only physical drives info.
`tdu [DIRS]` |Show total size in SI. Current dir by default.
2024-01-28 20:57:01 +03:00
2023-12-07 05:22:29 +03:00
## Docker.
2023-12-07 05:11:26 +03:00
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`docker_volumes <CONTAINER>` |Show container's volumes.
`docker_health` |Check if any container exited.
`docker_ip <CONTAINER>` |Find out container's IP address.
`docker_update` |Update all docker images.
`docker_prune` |Prune everything.
`dc` |Docker compose shortcut.
`dcu [SERVICES]` |Docker compose up.
`dcd [SERVICES]` |Docker compose down.
`dcp [SERVICES]` |Docker compose pull.
`dcl [SERVICES]` |Docker compose logs.
`dcr [SERVICES]` |Docker compose restart.
`dcs [SERVICES]` |Docker compose stop.
`dcdu [SERVICES]` |Docker compose down & up specified services.
`dcpu [SERVICES]` |Docker compose pull & up specified services.
`dcul [SERVICES]` |Docker compose up & attach to logs for specified services.
2023-12-07 05:11:26 +03:00
2023-12-10 04:31:03 +03:00
## Doc.
Command|Description
---|---
2024-01-03 16:47:45 +03:00
`doc_bash` |Generate a markdown file with all the help info. Outputs to `~/.doc/Bash.md` .
2023-12-10 04:31:03 +03:00
2024-01-17 20:22:36 +03:00
## Export.
Command|Description
---|---
2024-01-25 16:13:21 +03:00
`export_java [VERSION]` |Set java version. Sets to latest when not specified.
2024-01-17 20:22:36 +03:00
2023-12-07 05:11:26 +03:00
## Ffmpeg.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`ffmpeg_mux_audio <SOUND> <OUTPUT DIR>` |Mux audio into containers. File names in sound and current dirrectories must match.
`ffmpeg_mux_cover <FORMAT> <COVER>` |Mux cover into music file.
`ffmpeg_music_meta <FORMAT>` |Generate music metadata from directory structure. Top dir is the Artist name like this: `The_Beatles` . Next are albums like this: `2010_My_love` . Inside are songs like this: `01_sample.flac` .
2023-12-07 05:11:26 +03:00
## File.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`o <FILE>` |Open file/dir in GUI.
2024-01-15 15:55:58 +03:00
`play [FILE]` |Play media file from CLI. All files by default.
2023-12-07 05:11:26 +03:00
## Find.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`find_ext` |Find all file extensions.
`find_module` |Find all modules.
`find_function [MODULE]` |Find all module functions. Functions from all modules by default.
2023-12-07 05:11:26 +03:00
## Fix.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`fix_ethernet_speed <DEVICE> <SPEED>` |Fix when ethernet mistakenly detects 100 Mb instead of 1000 Mb. SPEED is one of 10/100/1000 etc.
`fix_files_sftp` |Fix nautilus after typing wrong sftp password.
2023-12-07 05:11:26 +03:00
## Git.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`gps` |Git push.
2024-01-11 00:32:09 +03:00
`gpsa` |Git push all (branches). Useful for pushing all stuff to a new remote.
2023-12-07 05:22:29 +03:00
`gpsf` |Git force push.
`gpl` |Git pull.
`gl` |Git log.
`gs` |Git status.
`gst` |Git stash.
`gd` |Git diff.
`gc` |Git commit.
`gch` |Git checkout.
`gchb <BRANCH>` |Git checkout branch.
`gb` |Git branch.
`gbd <BRANCH>` |Git branch delete.
`gbda` |Git branch delete all except current.
`gf` |Git fetch all.
`gt` |Git tag.
`gi` |Git ignore files.
`gpc <FILE>` |Git patch create.
`gp <FILE>` |Git patch (apply).
`ggc` |Run git garbage collection.
`ga [FILES]` |Preview diff while adding. Adds current dir by default.
`gr [COMMIT COUNT]` |Rebase by X commits or from root. When COUNT is 0 - rebase from root. Default is 2.
`gu [EMAIL]` |Specify git user as Dmitry Voronin with provided email.
`gg <REPO>` |Get my git repo.
`gdc <COMMITHASH>` |See diff for a specific commit.
2023-12-07 05:11:26 +03:00
2023-12-17 21:15:50 +03:00
## Group.
Command|Description
---|---
`group_ext [FILES]` |Group files by extension.
`group_year [FILES]` |Group files and dirs by year.
2024-01-27 19:42:37 +03:00
`group_year_current` |Copy files from current year to the named dir.
2023-12-17 21:15:50 +03:00
2023-12-07 05:11:26 +03:00
## Help.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`help <FUNCTION>` |Get help about dotfiles bash function.
`h <FUNCTION>` |Short for help.
2023-12-07 05:11:26 +03:00
## Ls.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`l [DIRS]` |List files in dirs. Current dir by default.
`ll [DIRS]` |List last modified files first. Current dir by default.
`lll [DEPTH] [DIRS]` |List files in tree structure. Current dir by default. Depth can be omitted by passing `-` (dash).
`llll [DIRS]` |List files recursively. Current dir by default.
`la [DIRS]` |List all files in dirs, incl. hidden files. Current dir by default.
`lla [DIRS]` |List all files in dirs, incl. hidden files, sorted by mtime. Current dir by default.
2023-12-07 05:11:26 +03:00
2024-01-09 14:47:08 +03:00
## Markdown.
Command|Description
---|---
`markdown_render <FILE.md>` |Render markdown in browser using Gitea API. Because I want consistency with Gitea web render. Works only inside LAN.
2023-12-07 05:11:26 +03:00
## Name.
Command|Description
---|---
2023-12-28 20:39:23 +03:00
`name [FILES]` |Rename dirs to `snake_case` and files to `PascalCase` . Careful with structured file names like archives!
2024-01-03 22:18:18 +03:00
`name_parse <PARSER> [FILES]` |Rename files with provided parser, i.e. `parse_simple` . All files by default.
2023-12-07 05:22:29 +03:00
`name_hash [FILES]` |Rename all files to their hashes while keeping extensions. All files by default.
`name_hash_check [FILES]` |Check hashes for previously renamed files. All files by default.
2024-01-18 00:26:43 +03:00
`name_show [FILES]` |Rename files for Jellyfin shows, i.e. `Episode S01E01.mkv` All files by default.
2023-12-07 05:22:29 +03:00
`name_manga <SEASON> [FILES]` |Rename files for Kavita manga format. All files by default.
2024-01-18 00:26:43 +03:00
`name_music [FILES]` |Rename files for ffmpeg_music_meta format. All files by default.
2023-12-07 05:22:29 +03:00
`name_ext <EXTENSION> [FILES]` |Rename files with new extension. All files by default.
`name_prefix <OLD> <NEW> [FILES]` |Change file name prefix. All matching files by default.
`name_postfix <OLD> <NEW> [FILES]` |Change file name postfix. All matching files by default.
`name_replace <OLD> <NEW> [FILES]` |Replace part of the name. All matching files by default.
2023-12-10 07:20:48 +03:00
`name_fix_numbering [FILES]` |Fix numbering for numbered files. I.e if there are 10 items and some of them start without zero, then append zero to it. 1..10 -> 01..10.
2023-12-07 05:11:26 +03:00
2024-01-24 18:49:45 +03:00
## Nix.
Command|Description
---|---
`nix_find <PACKAGE>` |Find Nix package path.
2024-01-24 19:06:50 +03:00
`nix_unstable` |Switch to Unstable branch.
2024-01-25 16:13:21 +03:00
`nix_channel` |Display current channel.
2024-01-31 03:32:45 +03:00
`nix_rebuild [HOSTNAME]` |Rebuild system. Optionally force the hostname.
`nix_update [HOSTNAME]` |Update system. Optionally force the hostname.
2024-01-24 22:17:40 +03:00
`nix_clean` |Free up root space.
2024-01-28 20:57:01 +03:00
`nix_shell [NAME]` |Spawn shell with specified nix environment. `Main` is default.
2024-01-28 21:27:27 +03:00
`nix_tmpshell <PACKAGES>` |Spawn nix-shell with specified packages.
2024-01-24 18:49:45 +03:00
2023-12-07 05:11:26 +03:00
## Notify.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`notify <MESSAGE>` |Send Telegram notification.
`notify_silent <MESSAGE>` |Send silent Telegram notification.
2023-12-07 05:11:26 +03:00
## Own.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`own [USER] [FILES]` |Change file ownership to specified user id and restrict access to him. Root user by default. This directory recursively by default.
2023-12-07 05:11:26 +03:00
## Pack.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`pack <TARGET.ext> [FILES]` |Pack files into desired format. All files and directories by default.
`unpack [FILES]` |Attempt to unpack. All supported formats by default.
2023-12-07 05:11:26 +03:00
## Parse.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`parse_simplify <STRING>` |Parse data and output simplified format.
2023-12-17 21:35:02 +03:00
`parse_pascal <STRING>` |Parse to PascalCase.
2023-12-17 21:15:50 +03:00
`parse_snake <STRING>` |Parse to snake_case.
2023-12-17 21:35:02 +03:00
`parse_kebab <STRING>` |Parse to kebab-case.
`parse_camel <STRING>` |Parse to camelCase.
2024-01-03 22:18:18 +03:00
`parse_snake_uppercase <STRING>` |Parse to SNAKE_CASE_UPPERCASE. **NOT STABLE! Repeating results in different output.**
2023-12-07 05:22:29 +03:00
`parse_alnum <STRING>` |Parse data keeping only alphanumeric characters.
2024-01-04 20:59:16 +03:00
`parse_ints <STRING>` |Parse integers from mixed string.
`parse_lowercase <STRING>` |Parse string to lowercase.
`parse_uppercase <STRING>` |Parse string to uppercase.
`parse_titlecase <STRING>` |Parse string to title case.
`parse_sentencecase <STRING>` |Parse string to sentence case.
`parse_startcase <STRING>` |Parse string to start case.
`parse_json <STRING>` |Parse string to pretty Json.
2023-12-07 05:11:26 +03:00
2024-01-31 03:32:45 +03:00
## Permission.
2023-12-07 05:11:26 +03:00
Command|Description
---|---
2024-01-31 03:32:45 +03:00
`perm_share` |Recursively change permissions to allow read sharing with group and others.
2023-12-07 05:22:29 +03:00
`perm` |Recursively change permissions to restrict access for group and others.
2023-12-07 05:11:26 +03:00
## Ps.
Command|Description
---|---
2023-12-10 04:31:03 +03:00
`ps [PROCESS]` |Find process and filter.
2023-12-07 05:11:26 +03:00
2023-12-28 20:39:23 +03:00
## Random.
Command|Description
---|---
`random_file` |Picks a random file or directory.
2023-12-07 05:11:26 +03:00
## Recursive.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`recursive <COMMAND>` |Run something recursively over all directories.
`recursive1 <COMMAND>` |Run something recursively over directories of 1 depth (excluding current dir).
2023-12-07 05:11:26 +03:00
## Rust.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`rust_book` |Open Rust book.
2023-12-07 05:11:26 +03:00
## Su.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`s [USER]` |Su shortcut for lazy me. Root by default.
2023-12-07 05:11:26 +03:00
## Terminal.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`tsize` |Get terminal size.
2023-12-07 05:11:26 +03:00
## Tmp.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`tmp` |CD into host's primary tmp dir.
2023-12-07 05:11:26 +03:00
## Tmux.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`ta [NAME]` |Create/attach to named session. By default uses name `main` .
`td` |Detach from running session.
2023-12-10 16:56:56 +03:00
`tda` |Detach all other tmux clients.
2023-12-07 05:22:29 +03:00
`tl` |List running sessions.
2024-01-07 22:40:11 +03:00
`tns [NAME]` |Assign name to session. Uses current dir name by default.
`tnw [NAME]` |Assign name to window. Uses current dir name by default.
2023-12-07 05:22:29 +03:00
`tk [NAME]` |Kill specified session. By default it kills `main` session.
`tka` |Kill all sessions.
2023-12-07 05:11:26 +03:00
## Todo.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`todo` |Open `~/.todo.md` file.
2023-12-07 05:11:26 +03:00
## Transcode.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`transcode <FORMAT> [FILES]` |Convert between different formats. By default tries to convert all files.
2023-12-07 05:11:26 +03:00
## Try.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`try <COMMAND>` |Retry command every 2 sec until it completes successfully.
2023-12-07 05:11:26 +03:00
## Vdl.
Command|Description
---|---
2023-12-10 04:31:03 +03:00
`vdl [LINK]` |Download video from URL. When no `[LINK]` specified, it tries to update previously downloaded link.
2023-12-07 05:22:29 +03:00
`vdl_vk <LINK>` |Temporary fix for vk downloads.
`vdl_file <FILE>` |Download all videos from file with links.
2023-12-07 05:11:26 +03:00
## Vi.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`v` |Neovim shortcut.
2023-12-07 05:11:26 +03:00
## Wallpaper.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`wallpaper <FILE>` |Set specified file as a wallpaper.
2023-12-07 05:11:26 +03:00
## Watch.
Command|Description
---|---
2023-12-07 05:22:29 +03:00
`w <COMMAND>` |Watch command output with 2 seconds interval.
`ww <COMMAND>` |Watch command output with minimal interval.
2023-12-07 05:11:26 +03:00