compare to alternative : - directly tests the -STOP of the process to continue or stop loop, - background operator should be set (or not) at the call of the function For extension i suggest a slowPID() based on kill like above and a slowCMD based on killall.
On my music directory, I create variable that contains all mp3s files, then I play them with mpg123. -C options enable terminal control key, s for stop, p for pause, f for forward to next song.
Get just the IP address for a given hostname. For best results, make this a function in your shell rc file so that it can be used for things like traceroute: Titus:~$ traceroute `getip foo.com` traceroute to 64.94.125.138 (64.94.125.138), 64 hops max, 52 byte packets Show Sample Output
Have wc work on each file then add up the total with awk; get a 43% speed increase on RHEL over using "-exec cat|wc -l" and a 67% increase on my Ubuntu laptop (this is with 10MB of data in 767 files).
By default, slot 1 is used for OTP purposes and validates against the Yubikey servers. Running the command above will replace that. If you have a Yubikey 2 or above, you can change -1 to -2 and program the second slot with a strong static key.
take a list of IP:PORT and output IP:PORT:COUNTRY Show Sample Output
Traffic details on the Ethernet interface. Show Sample Output
When you press "cmd+n" in TextMate, you can have "HTML" language as default document format... You can also define other languages too. You need to know the UUID of your language bundle.
Deletes files older than "n" minutes ago. Note the plus sign before the n is important and means "greater than n". This is more precise than atime, since atime is specified in units of days. NOTE that you can use amin/atime, mmin/mtime, and cmin/ctime for access, modification, and change times, respectively. Also, using -delete is faster than piping to xargs, since no piping is needed.
1.) my profile ends with $USER not with .default 2.) only grep for the first occurrence because some extensions have the translated name also inside the install.rdf Show Sample Output
This is an easy way to quickly get a status for a device in multipath on SLES systems, as long as the server is configured based on Novell's standards, where multipathed disks are referred to by /dev/disk/by-... tree. Make sure to replace name_of_vg with your Volume Group name.
Instead of dumping the entire query to the screen, it will use 'less -S' to handle pagination. This means you can move back and forward through the result set, and instead of wrapping rows at screen boundaries, the table will extend off the screen, and can be scrolled left and right with arrow keys.
1. Get name of task by task=$(basename "$(pwd)") 2. Check whether "$task.c" exists as a file 3. open "$task.c", "$task.in", "task.out" in vim with such layout. ------------------------------- | | $task.in | | | | |$task.c |-----------------| | | $task.out | | | | -------------------------------
This is a bit hacky, but if you're setting up a bunch of new LUNs, it can save a bunch of time. Also check out sfdisk. The fdisk will fail if, for example, a partition table already exists.
* Make a FIFO file named replypipe * listen on 1234 * pass the request to unix socket * unix socket will reply to replypipe * replypipe will write reply to the client
This command renames the file 'filename' to 'filename.old' using shell expansion. Same as typing "mv filename filename.old".
From a saved page of google search results, split out all of the links for the results. Useful for creating apache rewrite rules from.
Use this to make a launcher for Java apps ( .jar files ) such as with jdownloader
joins multiple lines to create single line with comma separated values. for example if we have an email addresses one per line (copy&paste from spreadsheet) it will oputput one line with comman separated addresses to put it to email client. Show Sample Output
This is helpful if you connect to several networks with different subnets such as 192 networks, 10 networks, etc. Cuts first three octets of ip from ifconfig command and runs nmap ping scan on that subnet. Replace wlan0 with your interface. Assumes class c network, if class b use: cut -d "." -f 1-2 and change nmap command accordingly.
This shows a list of channels from seeon.tv website to watch shows and movies
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: