Like the tiltle said, you can use an argument too ( the interface )
MyIps eth0
will show only the IP of this interface and the public IP
( tested with Linux )
You can add that function in ~/.bashrc, then
. ~/.bashrc
Now you are ready to call this function in all your terms...
Show Sample Output
The ^python$ is a package name patten. You can change whatever you want. Show Sample Output
Just a little simplification.
When working on a big proeject with SVN, you create quite much files, for now! Can just sit here and type svn add for all of them! svn status will return a list of all of file which get ?(not add), "M"(Modified), "D"(Deleted)! This code just grep "?" flag, then add it into SVN again!
This line does not include your closing tag in the output. Show Sample Output
Information for only one core. Show Sample Output
To learn more about Google Ngram Viewer: http://ngrams.googlelabs.com/info
* Replace USERNAME with the desired svn username * Replace the first YYYY-MM-DD with the date you want to get the log (this starts at the midnight event that starts this date) * Replace the second YYYY-MM-DD with the date after you want to get the log (this will end the log scan on midnight of the previous day) Example, if I want the log for December 10, 2010, I would put {2010-12-10}:{2010-12-11} Show Sample Output
No need for further filedes or substitution for splitting. Simply use read a b
If the first two letters are "ii", then the package is installed. You can also use wildcards. For example,
.
dpkg -l openoffice*
.
Note that dpkg will usually not report packages which are available but uninstalled. If you want to see both which versions are installed and which versions are available, use this command instead:
.
apt-cache policy python
Show Sample Output
recursively search dir for a a particular file type, search each file for a particular text. Show Sample Output
A quick find command to identify all TAR files in a given path, extract a list of files contained within the tar, then search for a given string in the filelist. Returns to the user as a list of TAR files found (enclosed in []) followed by any matching files that exist in that archive. TAR can easily be swapped for JAR if required. Show Sample Output
Inverse grep, to find files without the string
A shorter version Show Sample Output
This example command fetches 'example.com' webpage and then fetches+saves all PDF files listed (linked to) on that webpage. [*Note: of course there are no PDFs on example.com. This is just an example]
This will affect all invocations of grep, even when it is called from inside a script.
Alternatively,
ls -F | grep /\$
but will break on directories containing newlines. Or the safe, POSIX sh way (but will miss dotfiles):
for i in *; do test -d "./$i" && printf "%s\n" "$i"; done
Grabs the Apache config file (yielded from httpd) and returns the path specified as DocumentRoot. Show Sample Output
Much better alternatives - grep-alikes using perl regexps. With more options, and nicer outputs.
Find the usage of a switch with out searching through the entire man page.
Usage: manswitch [cmd] [switch]
Eg:
manswitch grep silent
____________________________
In simple words
man <cmd> | grep "\-<switch>"
Eg:
man grep | grep "\-o"
This is not a standard method but works.
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: