Category

cmd

  • 03.Sep.09
    Refreshing bash configuration cmd, shell | rafacas | (2)
    After writting some changes in the .bashrc file, you can reload it running this command: $ source ~/.bashrc or the even simpler $ . ~/.bashrc
  • 13.Jul.09
    OR in grep cmd | rafacas | (0)
    $ egrep "regexp1|regexp2" file1 file2 Search one or more files (file1 and file2 in our example) for lines that match any of several (two in our case) regular expressions: regexp1 OR regexp2. The '|' stands for the OR.
  • 10.Jul.09
    Adding password protection on a file with vim cmd, security | rafacas | (2)
    $ vim -x filename The -x option uses encryption when writing the file. It will ask for a key: Enter encryption key: ****** Enter same key again: ****** From then on your filename will be encrypted and accessed using the password. The -x option will no longer be necessary when editing the file.
  • 18.May.09
    Vi: emptying a file in one shot cmd | rafacas | (4)
    :1,$d This vi command blanks out the file being edited. Updated: javisantana suggested another way to emptying a file. Type: ggdG in command mode.
  • 12.May.09
    Quick access to the ASCII table cmd | rafacas | (0)
    man ascii Prints octal, hexadecimal and decimal listings of the ASCII character set.
  • 17.Apr.09
    Showing a computer’s open ports cmd, network | rafacas | (0)
    $ netstat -an | grep -i listen Shows the open ports on all the IPs of the computer the command is run on.
  • 12.Apr.09
    Extracting an rpm package without installing it cmd | rafacas | (0)
    $ rpm2cpio myrpmfile.rpm | cpio -idmv Extracts an rpm package in the current directory without installing it. It is very useful when you only want to see its contents.
  • 07.Apr.09
    Hearing a beep when your server comes online cmd | rafacas | (0)
    $ ping -i 60 -a host What do you do when you reboot your server? If you run this command you hear a beep when it comes online. The -i 60 option waits for 60 seconds between pings. The -a option includes an audible bell in the output when a packet is received.
  • 03.Apr.09
    Pulseaudio cmd, fun | fernape | (0)
    pulseaudio -D Launches the pulseaudio daemon for the active session. Try it. Switch to another terminal (Ctrl + Fx) and see what happens if other users are logged in or not.
  • 31.Mar.09
    RPM: listing the contents of an rpm file cmd | rafacas | (0)
    $ rpm -qpl kernel-2.6.27.19-170.2.35.fc10.i686.rpm /boot/System.map-2.6.27.19-170.2.35.fc10.i686 /boot/config-2.6.27.19-170.2.35.fc10.i686 /boot/initrd-2.6.27.19-170.2.35.fc10.i686.img /boot/vmlinuz-2.6.27.19-170.2.35.fc10.i686 [...] Lists all the files in an RPM file. Also note that rpm can query remote RPM files through FTP and HTTP.