Using urandom to get random data, deleting non-letters with tr and print the first $1 bytes.
http://manpages.ubuntu.com/manpages/hardy/man1/icotool.1.html There is also wrestool command. Show Sample Output
Copy files and dir in parallel. It is Faster.
Using the gnu-parallel.
Has 2 commands:
- First - Create dir structure in /BKP
find Files/ -type d | parallel 'mkdir -p /BKP/{}'
- Second - Copy for structure created
find Files/ -type f | parallel 'rsync -a {} /BKP/$(dirname {})'
- Great for backups!
- Can use "rsync" or "cp".
- Compare with a simple "rsync" or "cp"!
It's useful to run run git st before you commit changes. To see an individual commit it's good practice to type git diff . If you are happy with what you see, to add the file, just type ^diff^add
Old Sys5 system and SUN computers don't have the -H option. Adding /dev/null forces grep to use the multi-file output and report the file name.
The above is OK if you not worried about security, as per sshpass man pages: " The -p option should be considered the least secure of all of sshpass's options. All system users can see the password in the command line with a simple "ps" command." So, instead what I do is use the -e option: " -e The password is taken from the environment variable "SSHPASS"." Show Sample Output
Screen is a full-screen window manager that multiplexes a physical terminal between several processes.
Show what the process are opening many many file descriptos now, we can analyze this for the reason why server is worked slowly. Show Sample Output
This command is much faster than the alternatives, because it uses one cvs command to remove everything, instead of doing a separate cvs command for each individual file. The '-f' option removes the file from disk as well as from CVS. Note that those are backticks in the command (under the tilde key), not single quotes. Show Sample Output
It will generate a new file ending with "_ThumbnailImage.jpg" which is the embedded thumbnail inside the JPG for example.
The file .my.cnf located at user's home directory is used for mysql login. If this file exists, then
mysql -uYOURUSERNAME -pYOURPASSWORD database -e 'SOME SQL COMMAND'
can be replaced with
mysql database -e 'SOME SQL COMMAND'
It saves you from typing!
This is valid for mysqladmin and mysqldump commands as well.
Show Sample Output
Note, the [remotePort] should be opened in the firewall first. First, start the destination box listening, then fire off the sending box. Data from the /dev/zero device in memory of the source machine is read out using dd, sent over the network with nc, and read back in from the other side of the network with nc, going to the /dev/null device. Essentially, it is a memory-network-memory copy operation, the output of dd will tell you how fast your network really is performing.
Mostly for Norwegians, but easily adoptable to others. Very handy if you are brainstorming for a new domainname. Will only display the available ones.. You can usually do this better with dig, but if you dont have dig, or the TLD only have an online service to check with, this will be usefull.. Show Sample Output
The difference between this and the other alternatives here using only grep is that find will, by default, not follow a symlink. In some cases, this is definitely desirable.
Using find also allows you to exclude certain files, eg
find directory/ ! -name "*.tmp" -exec grep -ni phrase {} +
would allow you to exclude any files .tmp files.
Also note that there's no need for calling grep recursively, as find passes each found file to grep.
This will first remove any leading white space. If the line then starts with a comment character, it is cleared. If the result is an empty line, it's deleted. This allows for comment lines with leading white space.
I found this on http://fixnum.org/blog/2007/concat_pdfs_with_ghostscript/ so it's not my creation, but I think it's very useful and a good addition to this codebase. Show Sample Output
sxga ==> 1280x1024
vga ==> 800x600
------------------------------------------------
xwininfo -root | grep geometry
------------------------------------------------
This command displays the CPU idle + used time using stats from /proc/stat. Show Sample Output
By adding this to your bashrc, when SSH'ing to a server while screen is active it will change the window tittle to the name of the server you going to. 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: