Commands by piscue (3)

  • It eases the way of creating cron jobs of backup scripts. Just put this line as cron job, and all your backups are called sequentially. Allows you to forget, when in time, call this backup, just focus on your scripting. Also maintains the way of calling a single backup script when It's needed.


    0
    find /var/scripts -name 'backup*' -exec {} ';'
    piscue · 2013-07-24 21:25:21 2
  • with discard wilcards in bash you can "tail" newer logs files to see what happen, any error, info, warn... Show Sample Output


    5
    tail -f *[!.1][!.gz]
    piscue · 2009-03-06 16:24:44 3
  • rpm, sometimes, is not wildcard friendly. To search files installed from package this could be useful. change PACKAGENAME to any package do you want to search Show Sample Output


    1
    rpm -qa | grep PACKAGENAME | xargs rpm -q --filesbypkg
    piscue · 2009-02-26 14:32:12 0

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

Retry the previous command until it exits successfully

Print info about your real user.
To get your effective user: whoami

a shell function to print a ruler the width of the terminal window.

Show total disk space on all partitions
show off how big your disks are

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Perform sed substitution on all but the last line of input
In this simple example the command will add a comma to the end of every line except the last. I found this really useful when programatically constructing sql scripts. See sample output for example.

split source code to page with numbers

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

List your largest installed packages (on Debian/Ubuntu)
dpigs is in the package debian-goodies (debian/ubuntu)


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: