Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr3353 :: My terminal journey, part 01.

Becoming terminal friendly.

<< First, < Previous, , Latest >>

Thumbnail of Some Guy On The Internet
Hosted by Some Guy On The Internet on 2021-06-09 is flagged as Clean and is released under a CC-BY-SA license.
terminal, apt-get, apt-cache, .bashrc. 8.
The show is available on the Internet Archive at: https://archive.org/details/hpr3353

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:46:54

Apt Spelunking.

"Apt spelunking" is a silly term I made up for the act of searching through your package manager, App Store, Code Repo, etc with vague terms, and trying out random applications therein.
A public series started by Windigo.

Book TLCL

The Linux Command Line: https://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 "\n\n---\n\nNew Report\n\n---\n\n"'

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 "\n\nThis file is used to store terminal output for later use; now get out!\n\n" >> $dump;

echo -e "\n\nDump file $dump is ready for use (created on $(date +%m-%d-%Y_%T)).\n\n"

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

  1. the upgrade example sudo apt-get update | tee -a ~/Documents/.dump/dump05-05-2021.txt; nrpt >> ./dump05-05-2021.txt;

  2. 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

  3. the depends example apt-cache depends nmap >> ./dump05-05-2021.txt;

  4. the download example sudo apt-get download dict dictd dict-wn dict-gcide artha

  5. vim sudo apt-get vim; vimtutor

  6. Terminal examples ~= home folder, CTRL + R= command search , CTRL + L= clear terminal, xdg-open= open files with default app.

  7. Searching with grep example ls -lhAr ~ | grep -i bash >> ./dump05-05-2021.txt

  8. 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 https://dl.google.com/linux/chrome/deb stable InRelease
Ign:2 https://mirror.cs.jmu.edu/pub/linuxmint/packages ulyana InRelease
Get:3 https://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:4 https://mirror.cs.jmu.edu/pub/linuxmint/packages ulyana Release
Hit:5 https://mirror.cogentco.com/pub/linux/ubuntu focal InRelease
Hit:6 https://mirror.cogentco.com/pub/linux/ubuntu focal-updates InRelease
Hit:7 https://archive.canonical.com/ubuntu focal InRelease
Hit:8 https://mirror.cogentco.com/pub/linux/ubuntu focal-backports InRelease
Fetched 109 kB in 1s (158 kB/s)
Reading package lists...

---

New Report

---

brutespray - Python bruteforce tool
dindel - determines indel calls from short-read data
doscan - port scanner for discovering services on large networks
forensics-all - Debian Forensics Environment - essential components (metapackage)
forensics-all-gui - Debian Forensics Environment - GUI components (metapackage)
libfile-map-perl - Perl module providing simple and safe memory mapping
libnmap-parser-perl - module to parse nmap scan results with perl
libwlocate-dev - Library for doing location lookup based on free openwlanmap.org data
libwlocate0 - Library for doing location lookup based on free openwlanmap.org data
mapsembler2 - bioinformatics targeted assembly software
masscan - TCP port scanner
ncat - NMAP netcat reimplementation
ncrack - High-speed network authentication cracking tool
ndiff - The Network Mapper - result compare utility
nmap - The Network Mapper
nmap-common - Architecture independent files for nmap
nmapsi4 - graphical interface to nmap, the network scanner
p0f - Passive OS fingerprinting tool
pads - Passive Asset Detection System
pnscan - Multi threaded port scanner
psad - Port Scan Attack Detector
python-libnmap-doc - Python NMAP Library (common documentation)
python3-libnmap - Python 3 NMAP library
python3-nmap - Python3 interface to the Nmap port scanner
python3-scapy - Packet generator/sniffer and network scanner/discovery (Python 3)
samblaster - marks duplicates, extracts discordant/split reads
tophat-recondition - post-processor for TopHat unmapped reads
xprobe - Remote OS identification
xscreensaver-gl - GL(Mesa) screen saver modules for screensaver frontends

---

New Report

---

nmap
  Depends: nmap-common
  Depends: libc6
  Depends: libgcc-s1
  Depends: liblinear4
  Depends: liblua5.3-0
  Depends: libpcap0.8
  Depends: libpcre3
  Depends: libssl1.1
  Depends: libstdc++6
  Depends: lua-lpeg
  Depends: zlib1g
  Suggests: ncat
  Suggests: ndiff
  Suggests: <zenmap>

NATO Phonetic Alphabet

The NATO phonetic alphabet is a Spelling Alphabet; a set of words used instead of letters in oral communication (i.e. over the phone or military radio). Each word ("code word") stands for its initial letter (alphabetical "symbol"). The 26 code words in the NATO phonetic alphabet are assigned to the 26 letters of the English alphabet in alphabetical order as follows: Symbol, Code Word, Morse Code, Phonic.

(pronunciation)

A, Alfa/Alpha, AL FAH.
B, Bravo, BRAH VOH.
C, Charlie, CHAR LEE.
D, Delta, DELL TAH.
E, Echo, ECK OH.
F, Foxtrot, FOKS TROT.
G, Golf, GOLF.
H, Hotel, HOH TELL.
I, India, IN DEE AH.
J, Juliett, JEW LEE ETT.
K, Kilo, KEY LOH.
L, Lima, LEE MAH.
M, Mike, MIKE.
N, November, NO VEMBER.
O, Oscar, OSS CAH.
P, Papa, PAH PAH.
Q, Quebec, KEH BECK.
R, Romeo, ROW ME OH.
S, Sierra, SEE AIRRAH.
T, Tango, TANG OH.
U, Uniform, YOU NEE FORM.
V, Victor, VIK TAH.
W, Whiskey, WISS KEY.
X, X-ray, ECKS RAY.
Y, Yankee, YANG KEY.
Z, Zulu, ZOO LOO.

Hacker Public Radio

Correspondent: Some Guy On The Internet. Host ID: 391 E-mail: Lyunpaw@gmail.com

  • use hpr391 as the subject for all emails. If not, junk filter.

license: Creative Commons Attribution-ShareAlike 4.0 International

Shows:

  1. In GNU/Linux, there is no "diversity", we're all just data.

  2. Embrace Firefox

  3. HP Laptop with AMD Ryzen 3 Mobile with Radeon Graphics

  4. Poisoning The Well

  5. let's talk about Thunderbird

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2021-06-09 17:37:35 by FXB

Good listening.

Long time linux user, I but can fully sympathise with much of SGOTI's experience, seems to be a similar pattern in how many of us learn to use the command line.

Really well explained though, will make excellent listening for anyone new to the linux command line who finds it 'scary'.

Good stuff man, look forward to hearing more.

Comment #2 posted on 2021-06-09 21:23:15 by jezra

Hey, that's how I learned!

Wonderful show. It was an absolute delight to hear your command-line adventure. If there is one thing I have learned about the command-line in my years of computing, it is that there is always more to learn about the command-line. :)

Comment #3 posted on 2021-06-11 01:33:39 by Trey

Well done! Keep up the great work!

I have been using various flavors of *nix since the '80s, and I am still learning things. Your detailed and careful explanations are great for a beginner and even interesting to folks like me.

Don't worry about being new. You are learning methodically and are sharing what you learn with others. That is ALWAYS to be commended. Thank you!

Comment #4 posted on 2021-06-11 09:57:38 by archer72

Good to hear this one

Long time linux user, but still learning. I will definitely go back and listen again.

Two packages you might try are nnn and ranger, which are terminal application file managers. They both have good uses, just a different approach and keybindings.

Look forward hearing more.

Comment #5 posted on 2021-06-16 22:54:39 by Some Guy On The Internet

Giving Thanks.

Thank you all for the encouragement and kind words. I'll try to provide more shows on this and other topics. Has anyone had any issues with the sound quality or volume for the episode? Just a QA. check.

Comment #6 posted on 2021-06-19 06:19:12 by sesamemucho

Nice

A fine show with good audio, as have been all your shows.

I enjoyed the clear presentation. Always like hearing different ways to use the command line.

Thanks

Comment #7 posted on 2021-06-30 10:16:07 by frank

Comments and feedback on your show (part 1)

Hey some guy,

Regarding your surprise about pwd: I don't know the actual history, your assumption of a minimal prompt might be true. However, pwd is also very handy for scripting. Bear in mind that scripts don't have a prompt. ;-)

Pretend you are in directory A, and the script is in directory B. So in the terminal you enter B/script to run it. Now within that script, the variable $0 contains that calling string, i.e. B/script. But if you call pwd in that script, it returns A(!). So if you use ./ as path for your dump files, that means that the file will be created at your pwd.

I often write quick-n-dirty scripts for one-off tasks and they tend to use relative paths for simplicity. In such cases I use the following line at the start of the script: cd "$(dirname "$0")" This changes the script's current directory to where it is actually located. The quotes are there to handle spaces in path names and they are a good habit to acquire. (I'm kind of a language purist and don't like filenames riddled with underscores. I find them hard to read and hard to work with.)

Comment #8 posted on 2021-06-30 10:16:59 by frank

Comments and feedback on your show (part 2)

(I had to split my comment in two parts because I was getting an error if I did it in one post.)

About bash keyboard shortcuts: It is not a default setting in most distros, but I think it was in mine when I started with linux, and now I can't live without it. It allows to type a few characters and then, with the page up/down keys, page through all history entries that start with those characters you typed. For that, put the following into /etc/inputrc or ~/.inputrc: "\e[5~": history-search-backward "\e[6~": history-search-forward

Regarding grep: This comes from the g command of the ed editor, IIRC. "g" means "do the following command globally on the file" (vim has the :g command which does exactly that), "re" is the command to run and means "match with regular expression", and "p" means "if it matches, simply print the line".

PS.: it is unnecessary to touch a file if you write something to it right after (unless you use the result value of touch for error checking).

Happy vimming.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
What is the HOST_ID for the host of this show?
What does HPR mean to you?