Change the "run_command" to whatever command you want, and remove the "echo" to run it once you are happy.
If a session with named the same as your username already exists, then attach to it, otherwise create it
-c will count the number of times your search matches in the file. Show Sample Output
It is not the installed size in files, but the size of RPM packages. Show Sample Output
Shows all available keyboard bindings in bash. Pretty printing. Show Sample Output
This lists the number of ogg/mp3/wav/flac files in each subdirectory of the current directory. The output can be sorted by piping it into "sort -n". Show Sample Output
Same functionality without using bash functions. Show Sample Output
This command will show the sum total of memory used in gigabytes by a program that spawns multiple instances of itself. Replace chrome with whatever program's memory usage you are investigating. This command is rather useless on software that only spawns a single instance of itself. Show Sample Output
Displays memory usage for individual instances of an application that spawns multiple instances of itself. This command also works on single process applications. Show Sample Output
tput rmam
will disable line wrapping so that long lines are truncated to width of the terminal ($COLUMNS).
tput smam
will re-enable wrapping.
I've always used tput in bash scripts but I guess it works on the command line too.
Doesn't work in all terminals.
See http://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html
Using "wmic get * /value" within any Cygwin shell will return lots of Win/Dos newline junk ie "^M$" at the end of found value line, two lines ("$" Unix newline) above, and three below. This makes storing and or evaluating wmic queries as variables a pain. The method i suggest strips the mentioned junk, only returns the value after "OSArchitecture=", and includes only one Unix style newline. Other methods using sed|awk|cut can only handle the output of wmic cleanly when piped or using multiple sed statements.
wmic OS get OSArchitecture /value | sed 's/\r//g;s/^M$//;/^$/d;s/.*=//'
making
wmic OS get OSArchitecture /value | grep -Eo '[^=]*$'
a much cleaner and slightly less costly alternative.
Show Sample Output
In a multiple PostgreSQL server environment knowing the servers version can be important. Note that psql --version returns just the local psql apps version which may not be what you want. This command dumps the PostgreSQL servers version out to one line. You may need to add more command line options to the psql command for your connection environment. Show Sample Output
The 'rename' command with the first argument as "'s/\.//'" and the second argument as "" will remove the specified extension from the filenames.
Find all private keys and dump their fingerprints. Show Sample Output
The sed script ensures that the "random" MAC address is unicast (bit 0 of first byte == 0) and local (bit 1 of first byte == 1)
-t, --tuples-only print rows only Show Sample Output
Without using a pipe. -X ignores the user's .psqlrc configuration file -A sets un-aligned table output mode -t prints rows only (no headers or footers) Show Sample Output
Extracts domain and subdomain from given URl. See examples. Show Sample Output
Regular expression search pattern to remove the Datetime and Name when you paste from skype chat into your text editor From this Gist: https://gist.github.com/webstandardcss/3967760857d6be470dda
What's wrong with this? Show Sample Output
A simple bash function to the find command. I use this much more than find itself. 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: