-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc_help
More file actions
1372 lines (1139 loc) Β· 48.5 KB
/
.bashrc_help
File metadata and controls
1372 lines (1139 loc) Β· 48.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
#
# .bashrc_help - Enhanced Help System for DXSBash Environment
# Version 3.1.0 - Comprehensive Reference Guide
# Author: Luis Miguel P. Freitas
# Website: https://digitalxs.ca
# Color definitions for better readability
if [[ -t 1 ]]; then
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
WHITE='\033[1;37m'
BOLD='\033[1m'
DIM='\033[2m'
NC='\033[0m' # No Color
else
RED='' GREEN='' YELLOW='' BLUE='' PURPLE='' CYAN='' WHITE='' BOLD='' DIM='' NC=''
fi
# Main help display function
show_main_help() {
cat << EOF
${CYAN}
ββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββ${NC}
${BOLD}${WHITE}DXSBash - Professional Shell Environment${NC}
${DIM}Enhanced Bash configuration for Linux power users${NC}
${PURPLE}Version 3.1.0 | digitalxs.ca${NC}
${BOLD}${GREEN}βββ QUICK START βββ${NC}
${YELLOW}help <topic>${NC} - Show detailed help for specific topic
${YELLOW}help --list${NC} - List all available help topics
${YELLOW}help --search${NC} - Search commands by keyword
${YELLOW}help --examples${NC} - Show practical usage examples
${BOLD}${GREEN}βββ ESSENTIAL COMMANDS βββ${NC}
${WHITE}Navigation:${NC}
${CYAN}.., ..., ....${NC} - Go up 1, 2, 3 directories
${CYAN}bd${NC} - Back to previous directory
${CYAN}z <dir>${NC} - Smart directory jumping (zoxide)
${CYAN}zi${NC} - Interactive directory picker
${CYAN}mkdirg <dir>${NC} - Create and enter directory
${WHITE}File Operations:${NC}
${CYAN}extract <file>${NC} - Auto-extract any archive type
${CYAN}cpg <src> <dst>${NC} - Copy and go to destination
${CYAN}mvg <src> <dst>${NC} - Move and go to destination
${CYAN}ftext <pattern>${NC} - Search text in all files
${WHITE}System Info:${NC}
${CYAN}whatsmyip${NC} - Show internal/external IP
${CYAN}diskspace${NC} - Show disk usage by size
${CYAN}topcpu${NC} - Show top CPU processes
${CYAN}ports${NC} - Show active network ports
${WHITE}Git Shortcuts:${NC}
${CYAN}gs${NC} - git status
${CYAN}ga <files>${NC} - git add
${CYAN}gc${NC} - git commit
${CYAN}gp${NC} - git push
${CYAN}gl${NC} - git log
${WHITE}Package Management:${NC}
${CYAN}update${NC} - Update system packages
${CYAN}install <pkg>${NC} - Install package + updates
${CYAN}searchpkg <term>${NC} - Search for packages
${BOLD}${GREEN}βββ KEYBOARD SHORTCUTS βββ${NC}
${YELLOW}Ctrl+R${NC} - Fuzzy search command history
${YELLOW}Ctrl+F${NC} - Launch interactive directory navigator
${YELLOW}Alt+C${NC} - cd to selected directory (fzf)
${YELLOW}Tab${NC} - Enhanced auto-completion
${YELLOW}Ctrl+L${NC} - Clear screen (same as 'cls')
${BOLD}${GREEN}βββ HELP TOPICS βββ${NC}
${PURPLE}Core Topics:${NC}
${CYAN}navigation${NC} - Directory navigation and shortcuts
${CYAN}files${NC} - File operations and management
${CYAN}git${NC} - Git commands and workflows
${CYAN}search${NC} - Finding files and text
${CYAN}system${NC} - System information and management
${CYAN}network${NC} - Network tools and diagnostics
${PURPLE}Development:${NC}
${CYAN}python${NC} - Python development tools
${CYAN}node${NC} - Node.js and npm shortcuts
${CYAN}docker${NC} - Docker and container management
${CYAN}kubernetes${NC} - Kubernetes (k8s) commands
${PURPLE}Advanced:${NC}
${CYAN}shells${NC} - Multi-shell support (Bash/Zsh/Fish)
${CYAN}customization${NC} - Personalizing your environment
${CYAN}troubleshooting${NC} - Common issues and solutions
${CYAN}performance${NC} - Optimization tips and tricks
${PURPLE}Tools & Integration:${NC}
${CYAN}starship${NC} - Starship prompt features
${CYAN}zoxide${NC} - Smart directory navigation
${CYAN}fzf${NC} - Fuzzy finder usage
${CYAN}kde${NC} - KDE terminal integration
${BOLD}${GREEN}βββ MAINTENANCE βββ${NC}
${CYAN}update-dxsbash ${NC} - Update DXSBash
${CYAN}install_bashrc_support${NC} - Install dependencies
${CYAN}sudo reset-shell-profile <user>${NC} - Reset to defaults
${DIM}For detailed information: ${YELLOW}help <topic>${NC}
${DIM}For command examples: ${YELLOW}help --examples${NC}
${DIM}Documentation: ${BLUE}https://github.com/digitalxs/dxsbash${NC}
EOF
}
# List all available help topics
show_topic_list() {
echo -e "${BOLD}${GREEN}Available Help Topics:${NC}\n"
echo -e "${PURPLE}CORE FUNCTIONALITY${NC}"
echo -e " ${CYAN}navigation${NC} - Directory navigation, cd shortcuts, path manipulation"
echo -e " ${CYAN}files${NC} - File operations, permissions, archives, searching"
echo -e " ${CYAN}git${NC} - Git commands, workflows, and shortcuts"
echo -e " ${CYAN}search${NC} - Finding files, searching text, grep alternatives"
echo -e " ${CYAN}system${NC} - System info, processes, disk usage, monitoring"
echo -e " ${CYAN}network${NC} - Network diagnostics, IP info, port checking"
echo -e "\n${PURPLE}DEVELOPMENT TOOLS${NC}"
echo -e " ${CYAN}python${NC} - Python development, virtual environments, testing"
echo -e " ${CYAN}node${NC} - Node.js, npm, JavaScript development"
echo -e " ${CYAN}docker${NC} - Docker containers, images, compose"
echo -e " ${CYAN}kubernetes${NC} - Kubernetes cluster management"
echo -e "\n${PURPLE}ADVANCED FEATURES${NC}"
echo -e " ${CYAN}shells${NC} - Multi-shell support and configuration"
echo -e " ${CYAN}customization${NC} - Personalizing aliases, functions, prompt"
echo -e " ${CYAN}troubleshooting${NC} - Common problems and solutions"
echo -e " ${CYAN}performance${NC} - Optimization and efficiency tips"
echo -e "\n${PURPLE}TOOLS & INTEGRATION${NC}"
echo -e " ${CYAN}starship${NC} - Cross-shell prompt customization"
echo -e " ${CYAN}zoxide${NC} - Smart directory jumping and navigation"
echo -e " ${CYAN}fzf${NC} - Fuzzy finder integration and usage"
echo -e " ${CYAN}kde${NC} - KDE Konsole and Yakuake integration"
echo -e "\n${DIM}Usage: ${YELLOW}help <topic>${NC}"
}
# Search for commands by keyword
search_commands() {
local query="$1"
if [[ -z "$query" ]]; then
echo -e "${YELLOW}Enter search term:${NC}"
read -r query
fi
echo -e "${BOLD}${GREEN}Search results for: ${YELLOW}'$query'${NC}\n"
# Search in aliases
echo -e "${PURPLE}Aliases matching '$query':${NC}"
alias | grep -i "$query" | head -10 | while read -r line; do
echo -e " ${CYAN}${line}${NC}"
done
# Search in functions
echo -e "\n${PURPLE}Functions matching '$query':${NC}"
declare -F | grep -i "$query" | head -5 | while read -r line; do
func_name=$(echo "$line" | awk '{print $3}')
echo -e " ${CYAN}${func_name}${NC} - $(type "$func_name" | head -1 | cut -d' ' -f3-)"
done
# Search in help topics
echo -e "\n${PURPLE}Help topics matching '$query':${NC}"
case "$query" in
*nav*|*dir*|*cd*) echo -e " ${CYAN}navigation${NC} - Directory navigation and shortcuts" ;;
*file*|*cp*|*mv*) echo -e " ${CYAN}files${NC} - File operations and management" ;;
*git*) echo -e " ${CYAN}git${NC} - Git commands and workflows" ;;
*find*|*grep*|*search*) echo -e " ${CYAN}search${NC} - Finding files and searching text" ;;
*sys*|*proc*|*cpu*) echo -e " ${CYAN}system${NC} - System information and monitoring" ;;
*net*|*ip*|*port*) echo -e " ${CYAN}network${NC} - Network tools and diagnostics" ;;
*python*|*py*) echo -e " ${CYAN}python${NC} - Python development tools" ;;
*node*|*npm*) echo -e " ${CYAN}node${NC} - Node.js development" ;;
*docker*) echo -e " ${CYAN}docker${NC} - Container management" ;;
*k8s*|*kube*) echo -e " ${CYAN}kubernetes${NC} - Kubernetes commands" ;;
esac
}
# Show practical examples
show_examples() {
cat << 'EOF'
PRACTICAL USAGE EXAMPLES
========================
π NAVIGATION EXAMPLES
cd ~/Downloads && ls -la # Go to Downloads and list files
z doc # Jump to most-used directory containing "doc"
zi # Interactive directory picker
mkdirg new-project # Create and enter directory
up 3 # Go up 3 directories
bd # Go back to previous directory
π FILE OPERATION EXAMPLES
extract myfile.tar.gz # Auto-extract any archive
cpg important.txt ~/backup/ # Copy file and go to backup directory
ftext "TODO" # Find all files containing "TODO"
findlarge 100M # Find files larger than 100MB
showport 8080 # See what's using port 8080
π§ GIT WORKFLOW EXAMPLES
gs # Check git status
ga . # Add all changes
gc -m "Fix login bug" # Commit with message
gp # Push to remote
glog # Pretty git log with graph
π PYTHON DEVELOPMENT EXAMPLES
pyvenv myproject # Create and activate virtual environment
pipinstall # Install from requirements.txt
pyclean # Clean all Python cache files
pt tests/ # Run pytest on tests directory
pyserver 8000 # Start HTTP server on port 8000
π NETWORK DIAGNOSTICS EXAMPLES
whatsmyip # Show internal and external IP
ports # List all listening ports
showport 443 # Check what's using HTTPS port
myip # Quick external IP check
π SYSTEM MONITORING EXAMPLES
topcpu # Show top CPU-consuming processes
diskspace # Show directories by disk usage
meminfo # Detailed memory information
services # List all system services
π SEARCH AND FIND EXAMPLES
f "*.py" # Find all Python files
ftext "password" # Search for "password" in all files
h "git" # Search command history for git commands
p "nginx" # Find nginx processes
π οΈ DEVELOPMENT WORKFLOW EXAMPLES
# Python project setup
mkdirg my-api && pyvenv venv && pip install flask
# Git workflow
gs && ga . && gc -m "Initial commit" && gp
# Docker development
dps # List running containers
dex myapp bash # Execute bash in container
docker-clean # Clean up unused resources
# Quick file operations
extract archive.zip && cd extracted-folder && ls
π‘ PRODUCTIVITY TIPS
# Chain commands with &&
update && install vim && vim ~/.bashrc
# Use history expansion
!! # Repeat last command
!git # Repeat last git command
# Background processes
bk long-running-command # Run command in background
# Quick edits
edit ~/.bashrc && source ~/.bashrc # Edit and reload config
EOF
}
# Detailed help for specific topics
show_topic_help() {
local topic="$1"
case "$topic" in
"navigation")
cat << 'EOF'
DIRECTORY NAVIGATION
===================
π SMART NAVIGATION
z <partial_name> - Jump to frequently used directory
zi - Interactive directory picker (zoxide)
bd - Go back to previous directory ($OLDPWD)
π DIRECTORY SHORTCUTS
.. - Go up one directory
... - Go up two directories
.... - Go up three directories
..... - Go up four directories
up <N> - Go up N directories
home - Go to home directory
root - Go to root directory (/)
web - Go to web directory (/var/www/html)
π§ DIRECTORY OPERATIONS
mkdirg <name> - Create directory and cd into it
cpg <src> <dest> - Copy file/directory and cd to destination
mvg <src> <dest> - Move file/directory and cd to destination
pwdtail - Show last 2 parts of current path
π‘ NAVIGATION TIPS
- Use 'z' with partial directory names: z doc, z proj, z down
- Press Ctrl+F to launch interactive directory picker
- Use 'bd' to quickly return to where you came from
- Chain directory operations: mkdirg project && git init
π― EXAMPLES
z documents # Jump to Documents directory
zi # Pick directory interactively
mkdirg new-project && git init # Create project and initialize git
cpg important.txt ~/backup/ && ls # Copy file and list backup contents
EOF
;;
"files")
cat << 'EOF'
FILE OPERATIONS & MANAGEMENT
============================
π FILE LISTING
ls - Enhanced ls with colors and file types
la - List all files including hidden
ll - Detailed list with permissions
lt - List files sorted by modification time
lk - List files sorted by size
lf - List files only (no directories)
ldir - List directories only
tree - Show directory tree structure
π FILE OPERATIONS
cp - Copy (interactive, asks before overwrite)
mv - Move (interactive, asks before overwrite)
rm - Remove (interactive, verbose)
delete - Safer remove with confirmation
rmd - Remove directory and all contents
extract <file> - Auto-extract any archive type
π FILE SEARCHING
f <pattern> - Find files matching pattern
ftext <text> - Search for text in all files
findtext <pattern> - Find files containing specific text
findf <name> - Find files by name (excluding .git)
findd <name> - Find directories by name
findlarge [size] - Find files larger than size (default 100M)
ποΈ ARCHIVE OPERATIONS
mktar <file.tar> - Create tar archive
mkbz2 <file.tar.bz2> - Create bzip2 archive
mkgz <file.tar.gz> - Create gzip archive
untar <file> - Extract tar archive
unbz2 <file> - Extract bzip2 archive
ungz <file> - Extract gzip archive
extract <file> - Auto-detect and extract any archive
π PERMISSIONS
mx <file> - Make file executable
644 <target> - Set read/write for owner, read for others (with confirmation)
755 <target> - Set rwx for owner, rx for others (with confirmation)
showport <port> - Show what's using a specific port
π‘ FILE TIPS
- Use 'extract' for any archive type - it auto-detects format
- 'ftext' searches inside files, 'f' searches filenames
- Interactive rm/cp/mv prevents accidental overwrites
- Use 'findlarge 1G' to find files over 1 gigabyte
π― EXAMPLES
extract project.zip && cd project/ # Extract and enter directory
ftext "TODO" | head -10 # Find first 10 TODO items
findlarge 500M # Find files over 500MB
findf "*.py" | head -5 # Find first 5 Python files
EOF
;;
"git")
cat << 'EOF'
GIT COMMANDS & WORKFLOWS
=======================
π STATUS & INFO
gs - git status (show working tree status)
gl - git log (commit history)
glog - git log with pretty graph format
gloga - git log graph for all branches
gb - git branch (list branches)
gd - git diff (show changes)
β STAGING & COMMITTING
ga <files> - git add (stage files)
ga . - git add all changes
gc - git commit (open editor for message)
gcm "message" - git commit with inline message
gca - git commit --amend (modify last commit)
πΏ BRANCHING & NAVIGATION
gco <branch> - git checkout (switch branch)
gcob <name> - git checkout -b (create and switch to branch)
gm <branch> - git merge branch into current
gr - git rebase
gri - git rebase --interactive
π REMOTE OPERATIONS
gf - git fetch (download from remote)
gp - git push (upload to remote)
gpl - git pull (fetch and merge)
π§Ή CLEANUP & UTILITIES
grm <file> - git rm (remove file from git)
gst - git stash (temporarily save changes)
gstp - git stash pop (restore stashed changes)
gundo - git reset --soft HEAD~1 (undo last commit, keep changes)
gcp <commit> - git cherry-pick (apply specific commit)
π SEARCHING & INSPECTION
gg <pattern> - git grep (search in repository)
gsb - git show-branch (show branch relationships)
gt - git tag (list tags)
gk - gitk --all (graphical git browser)
π‘ GIT WORKFLOW TIPS
- Always check status with 'gs' before committing
- Use 'glog' to see commit history with visual graph
- 'gca' lets you modify the last commit message/content
- 'gundo' is safe way to undo last commit while keeping changes
π― COMMON WORKFLOWS
# Daily workflow
gs # Check status
ga . # Stage all changes
gcm "Fix user authentication" # Commit with message
gp # Push to remote
# Feature branch workflow
gcob feature/login-fix # Create and switch to feature branch
# ... make changes ...
ga . && gcm "Implement login fix" # Stage and commit
gco main && gm feature/login-fix # Switch to main and merge
# Emergency fixes
gst # Stash current work
gco hotfix && gcm "Critical fix" # Switch branch and commit fix
gstp # Restore stashed work
EOF
;;
"search")
cat << 'EOF'
SEARCHING & FINDING
==================
π FILE SEARCHING
f <pattern> - Find files by name (using find + grep)
findf <pattern> - Find files by name (excluding .git directories)
findd <pattern> - Find directories by name
findlarge [size] - Find files larger than specified size
π TEXT SEARCHING
ftext <pattern> - Search for text inside all files
findtext <pattern> - Find files containing specific text
grep <pattern> - Enhanced grep (uses ripgrep if available)
gg <pattern> - Git grep (search in git repository)
π HISTORY SEARCHING
h <pattern> - Search command history
Ctrl+R - Interactive history search (with fzf)
π PROCESS SEARCHING
p <pattern> - Search running processes
topcpu - Show top CPU-consuming processes
showport <port> - Find process using specific port
πΎ SYSTEM SEARCHING
where <command> - Better alternative to 'which'
checkcommand <cmd> - Check if command is alias, file, or builtin
π§ ADVANCED SEARCH OPTIONS
# Find with specific criteria
find . -name "*.py" -type f # Python files only
find . -size +100M -type f # Files over 100MB
find . -mtime -7 -type f # Files modified in last 7 days
find . -perm 777 -type f # Files with 777 permissions
# Text search with context
grep -n -A3 -B3 "pattern" file # Show 3 lines before/after match
grep -r "pattern" --include="*.py" . # Search only in Python files
# Process search variations
ps aux | grep nginx # Find nginx processes
pgrep -f nginx # Find processes by name
π‘ SEARCH TIPS
- Use 'ftext' to search inside files, 'f' to search filenames
- Combine with other commands: f "*.py" | head -5
- Use quotes for patterns with spaces: ftext "error message"
- Ctrl+R provides fuzzy search through command history
π― SEARCH EXAMPLES
ftext "TODO" | grep -v test # Find TODOs excluding test files
findlarge 1G # Find files over 1GB
h "git commit" | tail -5 # Last 5 git commit commands
p nginx | head -3 # First 3 nginx processes
findf "config" | grep -E "\.(json|yml)$" # Find config files
EOF
;;
"system")
cat << 'EOF'
SYSTEM INFORMATION & MONITORING
==============================
π» SYSTEM INFO
ver - Show detailed OS version information
cpuinfo - Display CPU information (lscpu)
meminfo - Show detailed memory information
mountedinfo - Show mounted filesystems (df -hT)
π PROCESS MONITORING
ps - Enhanced process listing (ps auxf)
topcpu - Show top 10 CPU-consuming processes
p <pattern> - Search for specific processes
services - List all system services (if systemctl available)
πΎ DISK USAGE
diskspace - Show disk usage sorted by size
folders - Show folder sizes in current directory
folderssort - Show folders sorted by size
df -h - Show disk free space (human readable)
π NETWORK MONITORING
ports - Show all listening ports (netstat -tulanp)
openports - Show open network connections
listening - Show only listening connections
showport <port> - Show what process is using specific port
netinfo - Display network configuration
whatsmyip - Show internal and external IP addresses
β‘ SYSTEM CONTROL
restart - Safe system reboot
forcerestart - Forced system reboot
turnoff - Power off system
update - Update system packages
install <package> - Install package with system update
π PERFORMANCE MONITORING
# CPU usage over time
cpu - Show current CPU usage percentage
# Memory monitoring
free -h - Human readable memory usage
# Process monitoring
watch -n 1 'ps aux --sort=-%cpu | head -10' # Top CPU processes updated every second
# Disk I/O
iostat 1 # Show I/O statistics (if available)
π§ SYSTEM UTILITIES
fastping - Quick network connectivity test
myip - Show external IP address
localip - Show local IP addresses
ips - List all IP addresses
path - Show PATH entries one per line
π‘ MONITORING TIPS
- Use 'topcpu' for quick CPU hog identification
- 'diskspace' helps find what's using disk space
- 'showport 80' to see what's running on HTTP port
- Chain commands: diskspace | head -10
π― SYSTEM EXAMPLES
topcpu # Find CPU-hungry processes
diskspace | head -5 # Top 5 space-consuming directories
showport 22 # Check SSH daemon
whatsmyip # Get both internal and external IPs
meminfo | grep -i available # Check available memory
EOF
;;
"network")
cat << 'EOF'
NETWORK TOOLS & DIAGNOSTICS
===========================
π IP ADDRESS INFO
whatsmyip - Show both internal and external IP addresses
myip - Show external IP address only
localip - Show local IP addresses (simplified)
ips - List all network interface IP addresses
π PORT MANAGEMENT
ports - Show all active network ports
openports - Show open network connections
listening - Show only listening ports
showport <port> - Find what process is using specific port
π‘ NETWORK DIAGNOSTICS
ping <host> - Enhanced ping (10 packets by default)
fastping <host> - Quick connectivity test (100 small packets)
netinfo - Display comprehensive network information
π CONNECTION MONITORING
ipview - Show HTTP connections to server
# Real-time connection monitoring
watch -n 1 'netstat -an | grep ESTABLISHED | wc -l'
π EXTERNAL CONNECTIVITY
# Weather information (if curl available)
weather - Full weather report from wttr.in
weather-short - Compact weather info
π‘ NETWORK TROUBLESHOOTING
# Check if service is running
showport 80 # Check if web server running
showport 22 # Check if SSH daemon running
showport 443 # Check if HTTPS server running
# Test connectivity
ping google.com # Test internet connectivity
fastping 8.8.8.8 # Quick test to Google DNS
# Check local network
localip # See your local IP
ping $(localip | head -1) # Ping your own interface
π§ ADVANCED NETWORK COMMANDS
# Show routing table
ip route show # Linux routing information
route -n # Traditional route display
# Network interface info
ip addr show # Detailed interface information
ifconfig # Traditional interface config
# DNS queries
nslookup google.com # DNS lookup
dig google.com # Detailed DNS information
π― NETWORK EXAMPLES
showport 3306 # Check if MySQL is running
whatsmyip # Get complete IP information
ports | grep :80 # Find web server processes
ping -c 3 $(echo $(myip)) # Ping your external IP
netinfo | grep -i dns # Find DNS configuration
EOF
;;
"python")
cat << 'EOF'
PYTHON DEVELOPMENT TOOLS
=======================
π PYTHON EXECUTION
py - Python 3 shortcut
py3 - Explicit Python 3
py2 - Python 2 (if available)
ipy - IPython interactive shell
pydoc <module> - Access Python documentation
π VIRTUAL ENVIRONMENTS
ve <name> - Create virtual environment
va - Activate virtual environment (./venv)
vd - Deactivate virtual environment
pyvenv <name> - Create and activate virtual environment in one step
π¦ PACKAGE MANAGEMENT
pipinstall - Install from requirements.txt
pipoutdated - List outdated packages
pipgraph - Show dependency tree (if pipdeptree installed)
π§ͺ TESTING & QUALITY
pt - Run pytest
ptr - Run pytest with verbose flags (-xvs)
ptw - Run pytest-watch (continuous testing)
lint - Run flake8 linter
black - Format code with Black
mypy - Run type checking with MyPy
π WEB FRAMEWORKS
# Django shortcuts
djrun - python manage.py runserver
djmig - python manage.py migrate
djmm - python manage.py makemigrations
djsh - python manage.py shell
djsu - python manage.py createsuperuser
djtest - python manage.py test
# Flask shortcuts
flrun - flask run
flshell - flask shell
π οΈ DEVELOPMENT UTILITIES
pytime <script> - Run Python script with timing information
pyprofile <script> - Profile Python script performance
pyserver [port] - Start simple HTTP server (default port 8000)
pyjson <file> - Pretty-print JSON file
pyclean - Clean all Python cache files and directories
π PROJECT ANALYSIS
# Find Python files
findf "*.py" | wc -l # Count Python files
ftext "TODO" --include="*.py" # Find TODOs in Python files
# Code statistics
find . -name "*.py" -exec wc -l {} + | tail -1 # Total lines of Python code
π‘ PYTHON WORKFLOW TIPS
- Always use virtual environments for projects
- Run 'pyclean' before committing to remove cache files
- Use 'ptr' for detailed test output with immediate failure stops
- 'pyserver' is great for quick file sharing over HTTP
π― PYTHON EXAMPLES
pyvenv myproject # Create and activate venv
pipinstall # Install dependencies
pt tests/ -v # Run tests verbosely
pyclean && git add . # Clean cache and stage files
pyserver 8080 # Start HTTP server on port 8080
EOF
;;
"node")
cat << 'EOF'
NODE.JS & NPM DEVELOPMENT
========================
π¦ NPM PACKAGE MANAGEMENT
ni - npm install (install dependencies)
nid - npm install --save-dev (install dev dependencies)
nig - npm install -g (install global package)
noup - npm update (update packages)
π PROJECT COMMANDS
ns - npm start (start application)
nt - npm test (run tests)
nb - npm run build (build application)
nr <script> - npm run <script> (run custom script)
π‘ NODE.JS WORKFLOW TIPS
- Check package.json for available scripts: cat package.json | grep -A10 scripts
- Use 'nid' for development dependencies like testing frameworks
- 'nig' for global tools like nodemon, create-react-app
- Always run 'ni' after cloning a Node.js project
π― NODE.JS EXAMPLES
ni # Install all dependencies
nid jest # Install Jest as dev dependency
nig nodemon # Install nodemon globally
nr dev # Run custom 'dev' script
nt # Run test suite
EOF
;;
"docker")
cat << 'EOF'
DOCKER & CONTAINER MANAGEMENT
============================
π CONTAINER OPERATIONS
dps - List running containers (docker ps)
dpsa - List all containers (docker ps -a)
drun <image> - Run interactive container
dex <container> <cmd> - Execute command in running container
dstop - Stop all running containers
πΌοΈ IMAGE MANAGEMENT
di - List all images (docker images)
dip <container> - Get container IP address
π MONITORING & LOGS
dlogs <container> - Show container logs
# Real-time log following
docker logs -f <container>
π§Ή CLEANUP OPERATIONS
dclean - Clean unused images and containers
docker-clean - Comprehensive cleanup (containers, images, networks, volumes)
π§ DOCKER COMPOSE
dc - docker-compose shortcut
dcup - Start services in background (docker-compose up -d)
dcdown - Stop and remove services (docker-compose down)
dcrestart - Restart all services
dclogs - Follow logs from all services
π‘ DOCKER TIPS
- Use 'dps' frequently to monitor running containers
- 'docker-clean' frees up significant disk space
- 'dex container bash' gives you shell access
- Always use 'dcdown' before 'dcup' when updating compose files
π― DOCKER EXAMPLES
drun ubuntu bash # Run Ubuntu container with bash
dex myapp /bin/sh # Execute shell in 'myapp' container
dlogs myapp | tail -50 # Show last 50 log lines
docker-clean # Clean up unused resources
dcup && dclogs # Start services and follow logs
EOF
;;
"kubernetes")
cat << 'EOF'
KUBERNETES (K8S) COMMANDS
========================
π― BASIC OPERATIONS
k - kubectl shortcut
kg - kubectl get (get resources)
kd - kubectl describe (describe resources)
π¦ RESOURCE MANAGEMENT
kgp - kubectl get pods
kgs - kubectl get services
kgn - kubectl get nodes
kdp <pod> - kubectl describe pod
π FILE OPERATIONS
kaf <file> - kubectl apply -f (apply configuration)
kdf <file> - kubectl delete -f (delete from configuration)
π INSPECTION & DEBUGGING
kl <pod> - kubectl logs (view pod logs)
ke <pod> <cmd> - kubectl exec -it (execute command in pod)
π CLUSTER MANAGEMENT
kctx <context> - Switch kubectl context
kns <namespace> - Switch to namespace
π‘ KUBERNETES TIPS
- Use 'kgp' to quickly see pod status
- 'kl podname -f' to follow logs in real-time
- Always verify context with 'kubectl config current-context'
- Use 'kns' to work in specific namespaces
π― KUBERNETES EXAMPLES
kgp -o wide # Get pods with more details
kl myapp-pod -f # Follow logs from myapp pod
ke myapp-pod bash # Execute shell in pod
kctx staging # Switch to staging context
kns development # Switch to development namespace
EOF
;;
"shells")
cat << 'EOF'
MULTI-SHELL SUPPORT
==================
π SUPPORTED SHELLS
DXSBash provides equivalent functionality across three shells:
Bash - Traditional, most compatible shell
Zsh - Enhanced features, popular alternative
Fish - Modern, user-friendly shell
π CONFIGURATION FILES
~/.bashrc - Bash configuration
~/.zshrc - Zsh configuration
~/.config/fish/config.fish - Fish configuration
π HELP FILES
~/.bashrc_help - This file (Bash help)
~/.zshrc_help - Zsh-specific help
~/.config/fish/fish_help - Fish-specific help
π SWITCHING SHELLS
chsh -s $(which bash) - Set Bash as default shell
chsh -s $(which zsh) - Set Zsh as default shell
chsh -s $(which fish) - Set Fish as default shell
βοΈ SHELL-SPECIFIC FEATURES
Bash:
- Most script-compatible
- Widely supported
- Extensive history and customization
Zsh:
- Enhanced tab completion
- Better history handling
- Oh-My-Zsh plugin ecosystem
- Advanced globbing patterns
Fish:
- Syntax highlighting as you type
- Intelligent autosuggestions
- Web-based configuration
- Modern scripting syntax
π οΈ INSTALLATION SUPPORT
install_bashrc_support - Install Bash dependencies
install_zshrc_support - Install Zsh dependencies
install_fish_support - Install Fish dependencies
π RESET TO DEFAULTS
sudo reset-shell-profile <user> - Reset current shell to defaults
sudo reset-bash-profile <user> - Reset Bash specifically
sudo reset-zsh-profile <user> - Reset Zsh specifically
sudo reset-fish-profile <user> - Reset Fish specifically
π‘ SHELL TIPS
- All shells share the same aliases and functions
- Starship prompt works consistently across all shells
- Use the shell that matches your workflow needs
- You can switch between shells anytime
π― SHELL EXAMPLES
echo $SHELL # See current shell
chsh -s $(which zsh) # Switch to Zsh
install_zshrc_support # Install Zsh tools
source ~/.zshrc # Reload configuration
EOF
;;
"customization")
cat << 'EOF'
CUSTOMIZATION & PERSONALIZATION
==============================
βοΈ CONFIGURATION FILES
~/.bashrc - Main Bash configuration
~/.bash_aliases - Personal aliases (safe to edit)
~/.config/starship.toml - Prompt customization
~/.config/fastfetch/config.jsonc - System info display
βοΈ SAFE CUSTOMIZATION
~/.bash_aliases - Add your personal aliases here
~/.bashrc.local - Personal functions and variables (create if needed)
π¨ PROMPT CUSTOMIZATION
Starship Configuration (~/.config/starship.toml):
- Modify colors, symbols, and information displayed
- Enable/disable modules (git, python, node, etc.)
- Customize format and layout
π SYSTEM INFO CUSTOMIZATION
Fastfetch Configuration (~/.config/fastfetch/config.jsonc):
- Change displayed information
- Modify colors and formatting
- Add or remove system details
π§ ADDING CUSTOM ALIASES
# Edit ~/.bash_aliases and add:
alias myproject='cd ~/projects/my-important-project'
alias ll='ls -alF'
alias grep='grep --color=auto'
π οΈ ADDING CUSTOM FUNCTIONS
# Add to ~/.bash_aliases:
myfunction() {
echo "This is my custom function"
# Your code here
}
π TERMINAL CUSTOMIZATION
KDE Konsole/Yakuake:
- Profile: DXSBash (auto-configured)
- Font: FiraCode Nerd Font
- Colors: Based on your theme
π‘ CUSTOMIZATION TIPS
- Always edit ~/.bash_aliases for personal changes
- Test aliases before adding: type them in terminal first
- Use 'source ~/.bashrc' to reload after changes
- Backup your customizations before major updates
π― CUSTOMIZATION EXAMPLES
# Add to ~/.bash_aliases
alias work='cd ~/work && ls -la'
alias backup='rsync -av ~/important/ /backup/location/'
# Custom function example
gitpush() {
git add .
git commit -m "${1:-Quick update}"
git push
}
# Environment variables
export EDITOR=nano
export BROWSER=firefox
EOF
;;
"troubleshooting")
cat << 'EOF'
TROUBLESHOOTING & COMMON ISSUES
==============================
π¨ COMMON PROBLEMS
β "Command not found" errors
- Check if tool is installed: command -v <tool>
- Reload shell configuration: source ~/.bashrc
- Check PATH: echo $PATH | tr ':' '\n'
- Install missing dependencies: install_bashrc_support
β Git commands not working
- Verify git is installed: git --version
- Check git configuration: git config --list
- Common fix: git config --global user.name "Your Name"
β Zoxide not working
- Check installation: command -v zoxide
- Verify initialization: grep -i zoxide ~/.bashrc
- Restart shell or run: source ~/.bashrc