Archive for category linux

rm -rf argument list too long

Well to often here is this the error message rm -rf argument list too long cause there are too many file in the directory. With the help of a little script those files can be deleted.

for FILE in `ls`
rm $FILE

Tags: , ,

Things to know about nano editor

Open nano with

nano -wcF

ALT + G = Goto Line Number
CTRL + R = Insert File
CTRL + W = Search String or by RegEx
ALT + R = Replace string or Replace by RegEx
ALT + , = Goto previous buffer
ALT + . Goto next Buffer

debian boots into uefi shell

Today one of my linux servers did not boot. Instead there was a grub uefi shell. Typing the help command listed a bunch of commands in dark blue on a dark grey. Not easy to read. Trying to use the gui did not solve the problem. Resetting the config did also not help. Some forum posts said to create a symlink to the efi file. My issue was that /boot/efi is a separate partion due btrfs on the my system.

What did work was using the command line to add the efi again.

bcfg boot add 0 fs0:\EFI\debian\grubx64.efi "Debian"

However writing in english mode on a german style keyboard is often “times of wonder”. Use # ( hash) for the backslash and ä for the quotes. I still wonder why I have to use a backslash on a linux system…

Tags: ,

Bash list only hidden files

A shortcut / alias for listing only hidden files and folders<

alias us="ls -la | grep ^- | awk '{print \$9}' | grep ^\\\."

print only file name with ls -l

There is an easy trick to display only the filename with ls -l

ls -l | awk '{print $9}'

nano goto line number

It is very hidden how to go to a line number in linux nano editor

  • strg + w
  • strg + t
  • enter Line number


Find the largest files on your linux system

Find the largest files on your linux system

cd /
du -k | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf  ("%6.1f\t%s\t%25s  %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),"*"x (1.5*$l),$2);}'


Subversion (svn) 1.8 on Debian 7 wheezy

Just installed a brand new debian and than I can’t use my working copies cause the svn version is still 1.6.x
So an upgraded is required!


wget -O /tmp/wd-deb.gpg
apt-key add /tmp/wd-deb.gpg
rm /tmp/wd-deb.gpg
sudo nano /etc/apt/sources.list

deb wheezy svn18

So now I can have fun again! Why not git? Cause the company repos are still in svn and I had some troubles with git-svn.

/dev/null: Permission denied

Das ist mal ein nette Fehlermeldung! Also, wie reparieren?

sudo rm /dev/null
sudo mknod -m 0666 /dev/null c 1 3

und schwups geht alles wieder. Bleibt nur die Frage, wieso und wann das  kaputt gegangen ist!?


farbige man pages

Man pages sind nicht immer sehr übersichtlich. Die man pages etwas einzufärben hilft!

ans Ende der .bashrc

export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'

schon sind die man pages in Farbe.

Tags: , , , ,

Archives by Subject:

Archives by Month: