Main Page

From CleanPosts

Revision as of 03:07, 24 February 2020 by Selah (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Linux Jedi Mind Tricks

  • Linux Novice - Someone who wonders what RTFM means.
  • Linux User - Someone who has tried to RTFM.
  • Windows User - Someone who has never heard RTFM.
  • Linux Guru - Someone who doesn't need to RTFM.
  • Linux Hacker - Someone who knows what isn't in TFM.
  • Linux Jedi - The one who WTFM.

Add line numbers to a file (5 digits, leading zeros, separated by a colon)

nl -i1 -s': ' -nrz -w5 twit3.txt >twit4.txt

Copy command-line output to clipboard

cat spock2.txt | xclip -selection clipboard

Generate a pdf from a man page

man -t vim | ps2pdf - > vim.pdf

Append an asterisk prefix to every line in a file

sed -ne 's/.*/* &/p' enterprise.txt > enterprise2.txt

Rename all files with extension .OUT with the extension .txt

rename 's/\.OUT$/.txt/' *

Extract gzip compressed tar archives

gunzip progs.tar.gz tar xvf progs.tar

Tally up a column of figures

#! /bin/sh
case "$1" in 
[1-9]*) colnum="$1"; shift;; 
*) echo "Usage: `basename $0` colnum [files]" 1>&2; exit 1;; 
esac 
awk '{sum += $col} 
END {print sum}' col=$colnum OFMT='%.2f' ${1+"$@"}

Convert a photo into an ASCII art representation directly into the terminal and save it to photo.ascii at the same time

jp2a Photo.jpg | tee photo.ascii

Change double-spaces in a text file to single spaces

cat redpine.txt | sed 's/ \+/ /g' > redpine2.txt

Delete empty files in and under the current directory

find . -empty -exec rm -f {} \;

Run the last command again as root

sudo !!

Make the text in a file all uppercase

cat testa.txt | tr '[a-z]' '[A-Z]' > testb.txt

Replace spaces in the filename of all the files in a directory with hyphens

find . -name "* *mp3" -exec rename 's/\ /-/g' {} \;

Michael-Neil-&-Graham-Getty---Retrochet-II---01---Cascade-Effect-Part-1.mp3

Convert all your files saved as "*.jpg-large" back to "*.jpg"

(so Twitter thinks they are images again)

find . -depth -name "*.jpg-large" -exec sh -c 'f="{}"; mv -- "$f" "${f%.jpg-large}.jpg"' \;

Find ten biggest hogs of disk space under a directory

du -s /usr/share/* | sort -nr | head

Prime factors of first 100 integers

echo {1..100} | factor

Make an image of a CD on your hard drive

dd if=/dev/sr0 of=image.iso

Mount that image on your system to use it

(The mount point must already exist)

mount -o loop image.iso /mnt/temp ===

Get a weather forecast for your city

curl wttr.in/seattle

Find files by name

find . -name *wav -print

Get information about all files of a certain type

find . -name *com -exec file {} \;

Print number of processes running as each user

$ ps -ef | awk '{print $1}' | sort | uniq -c

List the misspelled words in a file

enchant -l matthew

Return the name of the most-recently modified file in a directory

$ ls -t | head -1

20190506_061751k2.jpg

Strip blank lines from a text file

awk 'NF > 0' yeshua > yeshua2

Make all filenames in a directory lowercase

#!/bin/bash 
for x in `ls` 
do 
if [ ! -f $x ]; then 
continue 
fi 
lc=`echo $x | tr '[A-Z]' '[a-z]'` 
if [ $lc != $x ]; then 
mv -i $x $lc 
fi 
done 

paste into file called lowerit chmod u+x lowerit ./lowerit

Combine two files, line by line, comma delimited

$ paste -d, names.txt distances.txt

Concatenate a group of files into a single new file

for file in *; do cat $file >> linuxgal.txt; done

Find man page for a command

whereis -m genisoimage

genisoimage: /usr/share/man/man1/genisoimage.1.gz


Build a list of unique words in a file

tr ' ' \\n < notes20191108.txt | sort | uniq

Build an iso from a file

genisoimage -r -joliet-long -o -win98tib.iso /home/teresita/Desktop/iso/win98[7]20150529.tib


Burn an iso to a CD-ROM

Make a new .iso image in /mnt/burn from the contents in /mnt/hold

mkisofs -o /mnt/burn/image.iso /mnt/hold

Burn that image to another CD

cdrecord dev=/dev/sr0 /mnt/burn/image.iso

Convert RPM package to DEB package

alien file.rpm

Copy a file

cp INFILE OUTFILE

Add a CD-ROM to your list of repositories.

apt-cdrom -m add

List only non-blank lines in a file

awk 'NF >0' file.txt

Create a custom command to list files

alias l = 'ls -l --color=auto'

Add line numbers to a file

cat -n file.txt

Find text in a file

awk 'chevy' cars.txt

Backup Master Boot Record

dd if=/dev/sda of=MBR.img bs=446 count=1

Make a file lowercase

cat FILE1.TXT | tr '[A-Z]' '[a-z]' > FILE2.TXT

Change the owner of a directory and all its contents

chown -R teresita DIRECTORY

Grab a copy of a website

wget -w9 -r --random-wait -l3 -np -E URL

Display time since boot

uptime

Get the sizes of all subdirectories under a directory

du -sh MYDIR

Display unique lines in a sorted file

uniq <FILE1 >FILE2

Use CUPS printer management system

localhost:631 (in a browser address bar)

MP3 to WAV conversion

madplay --output=wave:OCEANLAB.WAV OCEANLAB.MP3

Convert to OGG

oggenc *

Create a link

ln -s /initrd/mnt/dev_ro2 HOME

Extract tarball

tar -xvf /dev/hda/FILE

Make archive

tar -c DIRECTORY | bzip2 > DIR.TAR.BZ2

Make a file executable for all users

chmod u+x FILE

Turn a directory into a SquashFS file

mksquashfs /tmp/merge PUP_412.SFS

Mount your SquashFS file

mount -o loop -t squashfs PUP_412.SFS /mnt/pup

Upload a file to your webspace

wput MYFILE ftp://username:password@web.host.com

Convert a MIDI file to a .WAV file

timidity -Ow -oRUBY.WAV RUBY.MID

Replace spaces in a filename with hyphens

find . -name "* *mp3" -exec rename 's/\ /-/g' {} \;

Print the current month in Julian dates

cal -j

Make a new file of the individual words in another file

tr ' ' '\012' <INFILE >OUTFILE

or

for WORD in `cat FILE`
do
echo $WORD
done

Strip carriage returns from a DOS file

tr -d '\015' <INFILE >OUTFILE

Downshift all file names

#!/bin/bash
for x in `ls`
do
if [ ! -f $x ]; then
continue
fi
lc=`echo $x  | tr '[A-Z]' '[a-z]'`
if [ $lc != $x ]; then
mv -i $x $lc
fi
done

Rename in bulk

OLD=xxx

NEW=yyy

for F in $OLD*

do

SUFFIX=`expr $F : '$OLD\(.*\)'`

mv $OLD$SUFFIX $NEW$SUFFIX

done

Install from tarball

tar -zxvf ARCHIVE.TAR.GZ

./configure

Format floppy disk

fdformat /dev/sde

List directories

find . -type d -print

=== Convert avi to mpeg ===

mencoder MOVIE.AVI -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 -o MOVIE.MPG -oac lavc -lavcopts acodec=mp2:abitrate=224 -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2:aspect=4/3

Factorial function implemented by recursion.

define fact(n)

{

if (n <= 1) return (n);

return (n * fact(n-1));

}

Perform a ROT 13 conversion

#!/bin/sh
echo "$1" | tr '[A-Za-z]' '[N-ZA-Mn-za-m]'

Download streaming videos and convert them to MP3s

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl

sudo chmod a+x /usr/local/bin/youtube-dl

youtube-dl --title --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=L3FmBjX-p0I

Convert decimal to 16 bit binary and trim leading zeros

#! /bin/bash
D2B=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1})
echo $((10#${D2B[$1]}))

Send a man page to the terminal minus the embedded backspace characters

man genisoimage | col -b | less

Print the first sixteen binary numbers using awk to align the data

echo "obase=2;i=0;while(i<=15) {i;i+=1}" | bc | awk '{printf "%4s\n", $0}'

TERMINAL CRUISE

A

A0-Z9 20191025 20200123 20200124 20200125

Fm To Title Summary
AAA AEI Students Chokhmah discovers sentient life on one of her rocky bodies
AEJ AEZ
AFA AKG Michael Chokhmah unites with a human to live among them
AKH AKZ
ALA AMX Patriarchs Melchizedek establishes the knowledge of Chokhmah on Earth
AMY AMZ
ANA APC Trial Michael is arrested and put on trial for preaching infidelity to the Law of Keter
AOD AOZ
AQA ARQ TC-Tribes The covenant people of Chokhmah flourish in Canaan
ARR ARZ
ASA AVI TC- Knot Salem is assailed by armies led by Zadkiel
AVJ AVZ
AWA AXD TC-Samaria The northern tribes form a kingdom that flourishes for a time
AXE AXZ
AYA AZZ Glossary A People, places, and things

B

Fm To Title Summary
BAA BCZ TC-Exile The Fallen Angels leave Salem forever
BEF BEZ
BDA BEC TC-Judah Chokhmah brings Samarian colonists to Heaven while Judah is left behind
BEF BEZ
BFA BGC TC-Truce Lilith and Samael set the frontier between House Larund and House Gerash
BGD BGZ
BHA BIE TC-Lael Lael leads colonists from Judah to Heaven
BIF BIZ
BJA BMZ TC-Demonstroke Lilith and Samael pay court to King Uriel of the House of Bellon
BNA BOI TC-Judea From the conquest of Nebuchadnezzar to the conquest of Pompey
BOJ BOZ
BPA BQW TC-Binah The courtship of Keter and Chokhmah
BQX BQZ
BRA BTZ TC-Jashen One of the B'nei Elohim is sent to retrieve the Golden Gift
BUA BUZ TC-Yohanan Yeshua comes to Yohanan to be baptized
BVA BXF TC-Ark Lael's group defends the Ark from a group from the Saiph League who would seize it
BXG BXZ
BYA BZZ Glossary B People, places, and things

C

Fm To Title Summary
CAA CEU TC-Rumbek Michael, Lilith, and Leliel come before King Metatron in Rumbek
CEZ CEZ
CFA CGR TC-Anshar Yeshua and Belial have a brief encounter in the land of Anshar
CGS CGZ
CHA CLZ TC-Roshites Gabriel and Remiel defend the Remnant from a force led by Belphegor
CLZ CLZ
CMA COH TC-Arrival The nobles attending the Council of Royals in Rumbek begin to arrive
COI COZ
CPA CXO TC-Yeshua Yeshua assumes leadership of Yohanan's group of disciples, and takes on more.
CXP CXZ
CYA CZZ Glossary C People, places, and things

D

Fm To Title Summary
DAA DZZ TC-B'nei Elohim
DAA DZZ
DAA DZZ TC-Council
DAA DZZ
DAA DZZ TC-Interlude
DAA DZZ
DAA DZZ TC-Risen
DAA DZZ
DAA DZZ TC-Elamites
DAA DZZ
DAA DZZ TC-Union
DAA DZZ
DAA DZZ TC-Way
DAA DZZ Glossary-D People, places, and things.

E-Z

E-Z

Personal tools
Strangers In Paradise