Commands using xargs (769)

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

Ping sweep without NMAP
Ping sweep without NMAP

Share your terminal session real-time
One person does `mkfifo foo; script -f foo' and another can supervise real-time what is being done using `cat foo'.

Check the package is installed or not. There will show the package name which is installed.
The ^python$ is a package name patten. You can change whatever you want.

list files recursively by size

Display Dilbert strip of the day
Requires display. Corrected version thanks to sputnick and eightmillion user.

Backup with SSH in a archive
$PRIVATEKEY - Of course the full path to the private key \n $HOST - The host where to get the backup \n $SOURCE - The directory you wish to backup \n $DESTINATION - The destination for the backup on your local machine

Download schedule
Downloads at 12:00

Check how far along (in %) your program is in a file
Imagine you've started a long-running process that involves piping data, but you forgot to add the progress-bar option to a command. e.g. $ xz -dc bigdata.xz | complicated-processing-program > summary . This command uses lsof to see how much data xz has read from the file. $ lsof -o0 -o -Fo FILENAME Display offsets (-o), in decimal (-o0), in parseable form (-Fo) This will output something like: . p12607 f3 o0t45187072 . Process id (p), File Descriptor (f), Offset (o) . We stat the file to get its size $ stat -c %s FILENAME . Then we plug the values into awk. Split the line at the letter t: -Ft Define a variable for the file's size: -s=$(stat...) Only work on the offset line: /^o/ . Note this command was tested using the Linux version of lsof. Because it uses lsof's batch option (-F) it may be portable. . Thanks to @unhammer for the brilliant idea.

Connect via sftp to a specific port
I use this for connect via sftp to a server listening on a non default ssh port.

convert pdf into multiple png files
syntax for resolution is: (see "man gs" for further informations) -rnumber -rnumber1xnumber2


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: