Scan a file and print out a list of ASCII characters that are not used in the file which can then be safely used to delimit fields. Useful when needing to convert CSV files using "," to a single character delimiter. Piping it into less at the end (which could be redundant) stops the command characters being interpreted by the terminal.
Tested in bash on AIX & Linux, used for WAS versions 6.0 & up. Sorts by node name. Useful when you have vertically-stacked instances of WAS/Portal. Cuts out all the classpath/optional parameter clutter that makes a simple "ps -ef | grep java" so difficult to sort through. Show Sample Output
you can find a special things(with defined -iname "*sql*") from in most of one direcroty(for example from both /etc/ and /pentest/) and then you can want to grep only include "map" word Show Sample Output
This is a handy command to put into ~/.bash_logout to automatically un-mount windows shares whenever the user logs out. If you use this on as a non-root account then you'll need to append sudo before umount and the user will need to have the appropriate sudoer rights to run the /bin/umount command.
Sample input:
kde-open -v
Qt: 4.7.4
KDE Development Platform: 4.7.3 (4.7.3)
KIO Client: 2.0
Show Sample Output
This command displays the CPU idle + used time using stats from /proc/stat. Show Sample Output
Find is used to "find" all filenames - grep shows those that are invalid.
Find all files under "." that are invalid NTFS filenames. Find locates all files, and grep shows the invalid ones.
Overwrite all sectors with zeros in one pass with ETA and speed status. If you wish to do more passes, encapsulate the line in a for loop (7 pass example): for f in `seq 1 7`; do pv -s `fdisk -l /dev/sdX|grep "Disk /"|cut -d' ' -f5` /dev/zero >/dev/sdX ; done Note: Substitute /dev/sdX with the correct drive you wish to erase. Also, you may have to be root to execute the command. Show Sample Output
Use this command if your file may contain empty lines and you need to optain the first non-empty line.
Kill all process that concide whit PATTERN Show Sample Output
See who is using a specific port. Especially when you're using AIX. In Ubuntu, for example, this can easily be seen with the netstat command. Show Sample Output
Removes comments and blank lines from configuration files, leaving only settings
You don't need to use "*", it will fail if the working directory has too many fails due parameter extension, you can simply pass the working directory using ".".
You don't need to use "*", it will fail if the working directory has too many fails due parameter extension, you can simply pass the working directory using ".".
short ip parameter and easy to remember grep call Show Sample Output
for music file of mp3.zing.vn Show Sample Output
useful to count events in logs Show Sample Output
useful to count events in logs @see: http://www.commandlinefu.com/commands/view/10327/report-summary-of-string-occurrence-by-time-period-hour#comment 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: