Two tips - missing files and uuencode/uudecode on RHEL (CentOS)
March 21st, 2008
Missing space - deleting open files
I ran into this one again today. If a file is open when deleted, it will not appear in a directory listing, but will take up space.
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
72G 58G 11G 86% /
# cat - >>large-file &
[1] 8958
# lsof large-file
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
cat 8958 root 1w REG 253,0 5120000000 4300883 large-file
# rm -f large-file
# lsof | grep large-file
cat 8958 root 1w REG 253,0 5120000000 4300883 /root/large-file (deleted)
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
72G 58G 11G 86% /
# kill -9 8958
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
72G 53G 15G 79% /
[1]+ Killed cat - >>large-file
uuencode/uudecode on RHEL (CentOS)
Earlier today I was looking to use uuencode on my RHEL host. Unfortunately, yum did not help:
# yum search uuencode Loading "installonlyn" plugin Setting up repositories base 100% |=========================| 1.1 kB 00:00 updates 100% |=========================| 951 B 00:00 addons 100% |=========================| 951 B 00:00 extras 100% |=========================| 1.1 kB 00:00 Reading repository metadata in from local files No Matches found
Furthermore, I struggled to find the correct search terms for Google to provide me with an answer. The correct package is “sharutils.” Anyways, for good measure, here is a quick demo of uuencode/uudecode:
$ echo "BASH Cures Cancer" > test.txt $ zip test.zip test.txt adding: test.txt (stored 0%) $ uuencode < test.zip - begin 664 - M4$L#!`H``````-%9=3@7HDD\$@```!(````(`!4`=&5S="YT>'155`D``^G> MXT?IWN-'57@$`/0!]`%"05-(($-U<F5S($-A;F-E<@I02P$"%P,*``````#1 M674X%Z))/!(````2````"``-```````!````M($`````=&5S="YT>'155`4` ?`^G>XT=5>```4$L%!@`````!``$`0P```$T````````` ` end $ uuencode < test.zip - | uudecode > test2.zip $ unzip test2.zip Archive: test2.zip replace test.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y extracting: test.txt $ cat test.txt BASH Cures Cancer
From the manual: “Uuencode reads file (or by default the standard input) and writes an encoded version to the standard output. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode. “


March 24th, 2008 at 4:56 pm
You could also use “yum whatprovides “, where is full path of the file that you’re looking for, instead of trying to track it down via google:
# yum whatprovides “*uuencode”
gmime.i386 : Library for creating and parsing MIME messages
sharutils.i386 : The GNU shar utilities for packaging and unpackaging shell archives.
gmime.i386 : Library for creating and parsing MIME messages
March 24th, 2008 at 5:45 pm
Thanks Wade! I learned on RH but I am long time Gentoo user and such, I am still learning yum….