I don’t think I’ve blogged about this but I’ve seen this sometime ago and now decided to add it to my .bashrc for good. It’s a simple trick to make an awesome PS1 shell prompt, displaying the branch you are currently on (if you’re in a git versioned directory). Not that I’m forgetting what branch [...]
Tags:
bash,
branch,
git,
prompt,
ps1,
shell,
terminal heroes,
tips,
tricks
I’ve upgraded my desktop and laptop last week. By “and” I mean that I’ve bought an desktop replacement class notebook – an Asus G73 series. Amongst many nice parts it has I’m very happy about the harddrives – Seagate Momentus XT, click the link to see an very interesting benchmark of it. Anyways, that’s not [...]
Tags:
bash,
fsf,
linux,
notebook,
script,
terminal
Awesomely create an pdf #slideshow from images: “convert *.png slides.pdf” #linux #bash #terminalheroes
Tags:
#slideshow,
#terminalheroes,
bash,
linux,
twitter
I have a low-memory VPS running online and thus always have to worry about what uses how much memory… Of course top and my favorite htop are very good tools to check this, but sometimes I just want to get a super simple report if I’m overusing memory or not yet. The bellow scripts (most [...]
Tags:
bash,
centos,
coding,
gnu,
gnu/linux,
shell,
terminal,
tricks
There is sometimes the need to kill some JVM, I usually use “killall java” and that works fine as long as that’s in fact what I want – kill ALL. But let’s say i just want to kill Tomcat and not my IDE? The below method works quite well in such an situation: [ktoso@homunculus ~]$ [...]
Tags:
bash,
coding,
java,
jee,
linux,
shell,
terminal
Let’s say you want to read the ps output inside an AWK script, it’s not so simple since system returns an exit code and not the string you want – it’s being sent to stdout, here is a simple trick to read multiple lines from a shell command inside awk: awk ‘BEGIN{while (“ps aux” | [...]
Tags:
awk,
bash,
coding,
free,
freedom,
gnu,
linux,
shell,
unix
Another Command Line Fu oneliner I’ve sumbited today: #show X window events in chosen window $ xev -id `xwininfo | grep 'Window id' | awk '{print $4}'` EnterNotify event, serial 13, synthetic NO, window 0×6400053, root 0x13c, subw 0x640005b, time 42431610, (367,0), root:(369,63), mode NotifyNormal, detail NotifyVirtual, same_screen YES, [...]
Tags:
bash,
coding,
command line fu,
gnu,
gnu/linux,
hack,
linux,
open source,
terminal,
tricks
Let’s drop a little humor in this time… You, brave Terminal Hero, shall kill -9 the daemon that has hidden itself in one of those files! We don’t know in which file you can find it though! We’re running out of time! The kingdom of GNU will be rm -rf‘d if you won’t make it [...]
Tags:
bash,
find,
gnu,
gnu/linux,
hack,
linux,
terminal,
tips
A great bash feature I just discovered is the “^blabla^bla” command (is it a “command” by the way..?) If typing stuff quickly by hand, typing mistakes (typos) happen… And it’s not really fast to fix them by using UP ARROW and then fixing the command by “hand”… A better, quicker way to do this is [...]
Tags:
bash,
coding,
gnu,
gnu/linux,
linux,
terminal