Author Archives: Linuxgal

About Linuxgal

Need a spiritual home? Consider joining us at Mary Queen of the Universe Latter-day Buddhislamic Free Will Christian UFO Synagogue of Vishnu

TC07 – Regicide

The “sea” of Aramel is a lake fed by melt water from a barren and twisted land, a low gravelly pass where the northern and southern sheets of ice came together as one. In the year following the return of … Continue reading

Posted in Uncategorized | Leave a comment

Vim

In Vim count occurrences of match: :%s/^TDD\d\d:/&/n

Posted in Uncategorized | Leave a comment

Palindate

Palindromic ISO dates between two years with #Python #!/usr/bin/python3 import sys from datetime import datetime from itertools import chain def palinDay(y): s = str(y) r = s[::-1] iso = ‘-‘.join([s, r[0:2], r[2:]]) try: datetime.strptime(iso, ‘%Y-%m-%d’) return [iso] except ValueError: return … Continue reading

Posted in Uncategorized | Leave a comment

Grep

Find non-text files: grep -iR -m 1 g” ” | grep “Binary file”

Posted in Uncategorized | Leave a comment

Rename

Recursively change spaces to hyphens in filenames: find . -name “* *” -print -exec rename “s/ /-/g” {} \;

Posted in Uncategorized | Leave a comment

Awk

List files and directories with sizes: ls -lF | awk ‘{printf “%s\t”, $5;printf “%s\n”,$9}’ or du -sk * | sort -rn | head -30

Posted in Uncategorized | Leave a comment

File

Find all the symbolic links in a directory: find /bin/ -name “*” | sort | xargs file -N | grep symbolic | sed ‘s/ symbolic link to//’

Posted in Uncategorized | Leave a comment

Apropos

Search man page summaries apropos ‘standard input’

Posted in Uncategorized | Leave a comment

Xclip

Copy command-line output to the system clipboard so you can fuck around in a GUI: cat spock2.txt | xclip -selection clipboard  

Posted in Uncategorized | Leave a comment

Set

List environment variables in order: set | awk ‘gsub(/(^)[[:upper:]]/,”&”) == NF’  

Posted in Uncategorized | Leave a comment