The Archives

  • 27.Nov.09
    Ignoring an alias cmd, shell | rafacas | (3)
    Sometimes I want to ignore an alias. That might seem to make no sense because one of the reasons (the reason?) to use an alias (like ls='ls --color') is creating shortcuts. But, in some cases I need to use the real command, with its real output. In my case, it is because I share the same username with other people on some systems (yes, it is pretty awful, but that is another issue). To do this, precede the command with a backslash: '\'. For example: $ \ls Update: As loood has said in the comments, typing the command in quotes has the same ...
  • 20.Apr.09
    Monitoring HTTP requests from the command line network | rafacas | (0)
    Some days ago Javisantana sent me a tweet with a link to a one-liner HTTP requests monitor. It goes as follows with some ouput added: $ sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" Password: tcpdump: listening on en1, link-type EN10MB (Ethernet), capture size 65535 bytes GET / HTTP/1.1 Host: GET / HTTP/1.1 Host: GET / HTTP/1.1 Host: GET / HTTP/1.1 Host: GET /intl/en_com/images/logo_plain.png HTTP/1.1 Host: [...] Replace en1 with your network interface's name. Usually enX in BSD-like OSes and ethX in Linux. You can create an alias named httpdump and add it to ~/.bash_profile: alias httpdump='sudo tcpdump -i en1 -n -s 0 -w ...
  • 18.Feb.09
    Alias shell | fernape | (0)
    This command, when invoked without arguments, shows the list of aliases in your shell session: $>alias alias dir='ls -l' alias l='ls -alF' alias md='mkdir -p' It also allows you to create your own aliases: $>alias lc='ls --color' If for some reason, you want to delete an alias, you can use the unalias command: $>unalias lc Aliases can help you saving a lot of time by avoiding repetitive and long commands and options. If you want them to be permanent, you should add those definitions to your .bashrc file.