Useful since "export http_proxy=blahblah:8080" doesn't seem to work with pear Show Sample Output
first 10 big file
rm-but() { ls -Q | grep -v "$1" | xargs rm -r ; }
Add this to your .bashrc file.
Then whenever you need to remove all files/directories but one from present working directory. Run:
rm-but <important-file-or-directory>
Notes:
1. This doesn't affect the hidden files.
2. Argument is actually as string. And all files/directories having this string in there name are left untouched.
This is an updated version that some one provided me via another "find" command to find files over a certain size. Keep in mind you may have to mess around with the print values depending on your system to get the correct output you want. This was tested on FC and Cent based servers. (thanks to berta for the update) Show Sample Output
Usage:
sftp-cp * | sftp user@host:/dir
This is useful if there is a process on the remote machine waiting for files in an incoming directory. This way it won't see half-transmitted files if it ignores hidden files.
More recent versions of the date command finally have the ability to decode the unix epoch time into a human readable date. This function makes it simple to utilize this feature quickly. Show Sample Output
It's actually really helpful if you've done a lot of replaces in say a header file, and now you want to replace the same text in the source code file.
Here's an awk version.
More straightforward. Show Sample Output
Find the length of the longest line of code in your files. Show Sample Output
Cleans all files in /tmp that have been accessed at least 2 days ago.
What was the name of that module we wrote and deleted about 3 months ago? windowing-something?
git log --all --pretty=format:" " --name-only | sort -u | grep -i window
This is the command to configure "cobbler reposync" to use a specific proxy setting to mirror locally the content of a specific remote repository.
# first install arp-scan if not have it arp-scan 10.1.1.0/24 .... show ip+mac in localnet awk '/00:1b:11:dc:a9:65/ {print $1}' .... get ip associated with MAC ` backtick make do command substitution passing ip to command ping Show Sample Output
Typical usage would be in a script that would want the next open UID in a range (in this case 500-600)
Say you have a directory structure like "foo/, foo/data/, bar/, bar/data/". If you just want to ignore 'bar/data' and you use "ack --ignore-dir=data pattern" it will ignore both foo/data and bar/data and 'ignore-data=bar/data' etc won't work.
Find and kill multiple instances of a process with one simple command.
Plays the mp3 stream of The Current as a background job. When you are done run:
fg %1
then to exit
Quite possible with Growl for mac I'd guess, although have not tried.
Libnotify needed for notification, stream will still work otherwise
this command prints itself out. it doesn't need to be stored in a file and it isn't as easy as
echo $BASH_COMMAND
for information on quines see http://en.wikipedia.org/wiki/Quine_(computing)
If you have lots of subversion working copies in one directory and want to see in which repositories they are stored, this will do the trick. Can be convenient if you need to move to a new subversion server. Show Sample Output
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.
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
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: