Commands by chon8a (2)

  • It can be used to create an index of a backup directory or to find some file.


    -2
    for file in *.zip; do unzip -l "$file" >> archiveindex.txt ; done;
    chon8a · 2013-05-02 01:43:26 8
  • Get the first 10 google results form a querry, but showing only the urls from the results. Use + to search diferent terms, ex: commandlinefu+google . Show Sample Output


    1
    gg(){ lynx -dump http://www.google.com/search?q=$@ | sed '/[0-9]*\..http:\/\/www.google.com\/search?q=related:/!d;s/...[0-9]*\..http:\/\/www.google.com\/search?q=related://;s/&hl=//';}
    chon8a · 2012-04-21 03:31:26 7

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)

Remove old kernel packages

view http traffic

List processes playing sound
When trying to play a sound you may sometimes get an error saying that your sound card is already used, but not by what process. This will list all processes playing sound, useful to kill processes that you no longer need but that keep using your sound card.

Copy all documents PDF in disk for your home directory
I used this to copy all PDFs recursively to a selected dir

Freshening up RKhunter
Not everyone reads manpages. Aliasing this command will help with the task of doing audits with RKhunter. It will check for the latest version, update the definitions and then run a check on the system. Hint: alias that in your .bashrc to make life for your fingers easier.

Shows you how many hours of avi video you have.
midentify.sh is part of mplayer, but you might have to locate it on your box.

Advanced python tracing
Trace python statement execution and syscalls invoked during that simultaneously

List of computers not logged into in more than four weeks

Find out current working directory of a process
This is an alternative to another command using two xargs. If it's a command you know there's only one of, you can just use: $ ls -l /proc/$(pgrep COMMAND)/cwd


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: