Category

cmd

  • 03.26.09
    Mounting ISO images cmd | rafacas | (0)
    # 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.09
    RPM: listing files in installed packages cmd, network | rafacas | (0)
    # 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.09
    Ten largest files/dirs cmd | rafacas | (0)
    $ 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.09
    nohup: put your computer to work and leave cmd, scripts | pfortuny | (0)
    $ 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.09
    Converting filenames to lowercase cmd | rafacas | (0)
    $ 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.09
    System information cmd, shell | n0str0m0 | (0)
    $ echo $OSTYPE $MACHTYPE freebsd7.1 amd64-portbld-freebsd7.1 Easy way of getting information with bash
  • 03.02.09
    Adding ‘tail -f’ behavior to ‘less’ cmd | rafacas | (0)
    $ 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.09
    Displaying last lines of a file in real time cmd | rafacas | (0)
    $ tail -f /var/log/messages Displays continously (in "real time") the last lines of /var/log/messages as it grows.
  • 02.12.09
    Fix package database cmd, shell | n0str0m0 | (0)
    % pkgdb -F In FreeBSD, interactively fixes the package database. Useful after an upgrade.
  • 02.08.09
    Unlocking a user account cmd | rafacas | (0)
    # passwd -u user Unlocks user's account. That is, lets user log in (a locked account is one prevented from logging in).