My terminal journey, part 01. Becoming terminal friendly.
series: Apt Spelunking.
tags: terminal, apt-get, apt-cache, .bashrc
Book TLCL
The Linux Command Line: http://www.linuxcommand.org/tlcl.php
My .bashrc alias
# ls aliases
alias la='ls -Alh --group-directories-first'
alias lr='ls -lh --group-directories-first --recursive'
alias lar='ls -Alh --group-directories-first --recursive'
# safety first ;)
alias rmi='rm --interactive --verbose'
alias mvi='mv --interactive --verbose'
alias cpi='cp --interactive --verbose'
# cd reverse dir
alias ..='cd ..'
alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
# cd dir
alias cd.d='cd ~/Documents/.dump'
# shutdown | reboot
alias ssn='sudo shutdown -P now'
alias sr='sudo reboot'
# Misc
alias nrpt='echo -e "nn---nnNew Reportnn---nn"'
My dump script
#!/bin/bash
dump=dump$(date +%m-%d-%Y).txt
pdat=$(date +%a_%b_%d_%Y_%T)
touch $dump;
echo -e "$pdat" > $dump; echo -e "nnThis file is used to store terminal output for later use; now get out!nn" >> $dump;
echo -e "nnDump file $dump is ready for use (created on $(date +%m-%d-%Y_%T)).nn"
My Upgrade script
#!/bin/bash
dp=dump$(date +%m-%d-%Y).txt
date | tee -a ./$dp; echo -e "n" | tee -a ./$dp;
sudo apt-get update | tee -a ./$dp; echo -e "n" | tee -a ./$dp;
echo -e "System Update Completed." | tee -a ./$dp; echo -e "n" | tee -a ./$dp;
sudo apt-get upgrade --yes | tee -a ./$dp; echo -e "n" | tee -a ./$dp;
echo -e "System Upgrade Completed." | tee -a ./$dp; echo -e "n" | tee -a ./$dp;
Commands
the upgrade example sudo apt-get update | tee -a ~/Documents/.dump/dump05-05-2021.txt; nrpt >> ./dump05-05-2021.txt;
the nmap example (plus the other command I couldn't remember while recording) apt-cache search nmap >> ./dump05-05-2021.txt; nrpt >> ./dump05-05-2021.txt; apt-cache showpkg nmap
the depends example apt-cache depends nmap >> ./dump05-05-2021.txt;
the download example sudo apt-get download dict dictd dict-wn dict-gcide artha
vim sudo apt-get vim; vimtutor
Terminal examples ~= home folder, CTRL + R= command search , CTRL + L= clear terminal, xdg-open= open files with default app.
Searching with grep example ls -lhAr ~ | grep -i bash >> ./dump05-05-2021.txt
the dump05-05-2021.txt file
Wed_May_05_2021_12:22:43
This file is used to store terminal output for later use; now get out!
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Ign:2 http://mirror.cs.jmu.edu/pub/linuxmint/packages ulyana InRelease
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:4 http://mirror.cs.jmu.edu/pub/linuxmint/packages ulyana Release
Hit:5 http://mirror.cogentco.com/pub/linux/ubuntu focal InRelease
Hit:6 http://mirror.cogentco.com/pub/linux/ubuntu focal-updates InRelease
Hit:7 http://