Category
cmd
-
03.26.09Mounting ISO images# mount -o loop file.iso /mnt/iso Mounts an iso image on the /mnt/iso directory. The loopback module needs to be enabled.
-
03.22.09RPM: listing files in installed packages# rpm -ql postgresql-libs /usr/lib/libecpg.so.6 /usr/lib/libecpg.so.6.0 /usr/lib/libecpg_compat.so.3 /usr/lib/libecpg_compat.so.3.0 /usr/lib/libpgtypes.so.3 /usr/lib/libpgtypes.so.3.0 /usr/lib/libpq.so.5 /usr/lib/libpq.so.5.1 [...] Lists all files of an installed package. It works only if the package is already installed on your system
-
03.16.09Ten largest files/dirs$ du -sm * | sort -rn | head -10 Shows the ten largest files/dirs in the working directory. I find it very useful when I need more free space.
-
03.12.09nohup: put your computer to work and leave$ nohup R -q -f batch & That was how I made my Department's computer run a lot of computations in R from a remote shell, while being able to log out without killing the process (it runs on even if you log out). You might redirect the output somewhere (it gets saved in a file called nohup.out by default). Nohup stands for "Do not comply with HUP signals".
-
03.10.09Converting filenames to lowercase$ for i in *; do mv "$i" "$(echo $i|tr [:upper:] [:lower:])"; done Turns all uppercase characters in the present directory filenames into lowercase. There is no collision detection, so if some name gets repeated, the destination file will be overwritten and the first file will be lost. Use the above if you know that there will be no collisions.
-
03.08.09System information$ echo $OSTYPE $MACHTYPE freebsd7.1 amd64-portbld-freebsd7.1 Easy way of getting information with bash
-
03.02.09Adding ‘tail -f’ behavior to ‘less’$ less +F /var/log/messages The +F option turns on less 'follow mode'. It is similar to tail -f but you will have the benefits of less, like scrolling up and down. To stop tailing, use Ctrl-C and to resume it, press Shift-F.
-
02.20.09Displaying last lines of a file in real time$ tail -f /var/log/messages Displays continously (in "real time") the last lines of /var/log/messages as it grows.
-
02.12.09Fix package database% pkgdb -F In FreeBSD, interactively fixes the package database. Useful after an upgrade.
-
02.08.09Unlocking a user account# passwd -u user Unlocks user's account. That is, lets user log in (a locked account is one prevented from logging in).