The old blog · Tag
bash
-
Bash: Get largest files in a directory
Tweet So you have a partition with a ton of subdirectories and the partition is almost full and you want to see if there are large files eating up space. There is an easy command you can run to list the 10 biggest files …
-
Remove Leading 0’s in Bash
Tweet So you have a var you want to remove leading 0’s on.. well do the follwing mzupan@mzupan-desktop:~$ var=00014 mzupan@mzupan-desktop:~$ let var=”10#$var” mzupan@mzupan-desktop:~$ echo …
-
Line breaks in command output redirect
Tweet Every now and then you need to save command output into a bash var from a command. Generally it looks like VAR=`command` That will put the stdout of command into $VAR There is an issue if the output has …
-
Bash Command Logger with Curl Support
Tweet There is a great project called Bash Paranoia. Right now their site is busted so I can’t link to it. Its a patch that applies to bash that allows commands to be logged to syslog. I basically took this one …