This line unbuffers the interactive output of rsync's --progress flag creating a new line for every update. This output can now be used within a script to make actions (or possibly piped into a GUI generator for a progress bar)
Took one of the samples, added capitalization and removes in between spaces. The final "echo" is just for readability. Cheers Show Sample Output
Thx Mass1 for the sharing
In the field, I needed to script a process to scan a specific vendor devices in the network. With the help of nmap, I got all the devices of that particular vendor, and started a scripted netcat session to download configuration files from a tftp server. This is the nmap loop (part of the script). You can however, add another pipe with grep to filter the vendor/manufacturer devices only. If want to check the whole script, check in http://pastebin.com/ju7h4Xf4 Show Sample Output
Removes directories which are less than 1028KB total. This works for systems where blank directories are 4KB. If a directory contains 1 MB (1024KB) or less, it will remove the directory using a path relative to the directory where the command was initially executed (safer than some other options I found).
Adjust the 1028 value for your needs.
It would be helpful to test the results before proceeding with the removal. Simply run all but the last two commands to see a list of what will be removed:
du | awk '{if($1<1028)print;}' | cut -d $'\t' -f 2-
If you're unsure what size a blank folder is, test it like this:
mkdir test; du test; rmdir test
I had trouble with accent I could do a simple mv by hand but it is not efficient. I found this online http://www.unix.com/shell-programming-and-scripting/158635-remove-spanish-accent-file-name.html but I could not specify the accented letter direcly because it is not in the same encoding as my cli so I changed the char for their octal value. to add accent I use this table http://linux.about.com/library/cmd/blcmdl7_iso_8859-1.htm and add the values to the tr part. the other "duplicates" where not working for me. comment to help me better this script. :) Show Sample Output
Inspired by Tatsh's comment.
useful for human readable reports Show Sample Output
remove the IP from proxy reverse server and parentesis from real IP obtained from X-forwarder_IP Show Sample Output
Puts words on new lines, removing additional newlines.
Searches in order of the directories of $PATH. Stops after finding the entry; looks for only that fileName. Works in Bourne, Korn, Bash and Z shells. Show Sample Output
For BSD-based systems, including OS X, that don't have seq.
This version provides a default using tput in case $COLUMNS is not set:
jot -b '#' -s '' ${COLUMNS:-$(tput cols)}
Show Sample Output
Doesn't use shuf, its much faster with "shuf -n4" instead of sort -R Show Sample Output
pwgen 30 Show Sample Output
The first grep rejects capitalised words since the dict has proper nouns in it that you mightn't want to use. The second grep rejects words with ending in apostrophe s, and the third forces the words to be at least 15 characters long. Show Sample Output
This will, for an application that has already been removed but had its configuration left behind, purge that configuration from the system. To test it out first, you can remove the last -y, and it will show you what it will purge without actually doing it. I mean it never hurts to check first, "just in case." ;)
curl doesn't provide url-encoding for 'GET' data, it have an option '--data-urlencode', but its only for 'POST' data. Thats why I need to write down this commandline. With 'perl', 'php' and 'python', this is one liner, but just I wrote it for fun. Works in Ubuntu, will work in all linux varients(I hope it will work in unix varients also). Show Sample Output
all files in the directory get moved, in doing so the new name of the file is the original name with out spaces (using translate command)
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: