commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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:
Starts the Performance Monitor console that monitors the system load. It will help to observe and test the system or parts of the system and also help to find any problems.
tells you the number of lines in said file, and then tail the last 100 lines ( or how many are messed up) then u take the total amount of lines and then subract the 100 or so lines u DONT WANT, then do a head -n $new_number and then redirect it to new file.db
doskey is the Windows cmd.exe equivalent of the Unix alias. '$*' means 'all parameters'
This example is like alias l='ls -alrt': it will display files from oldest to newest, for one or more directories.
doskey /MACROS list macros defined for cmd.exe, like 'alias' list aliases defined for the current Unix shell.
Useful to quickly get back to the Windows root directory of the current drive from a sub-directory within that drive.
Works also without space between 'cd' and backslash: 'cd\' or 'cd \' have the same effect
Show device drivers and their properties, including digital signatures /si and in table format /fo.
Show message in file "welcome" to all logged in terminal users.
usage: renam
in a script you must replace $PPID with $(awk '{print $4}' /prod/$PPID/stat)
This command limits the oputut of git log to one-line per commit and an abbreviated commit ID.
find -printf '%u\n' | sort | uniq #just users
find -printf '%g\n' | sort | uniq #just groups
If you have tried to change your prompt and made a mistake, use this command to retrieve a standard prompt.
If you used the export command when you changed your prompt, also use it there:
export PS1='$PWD$ '
Solution to activate (or deactivate with false instead of true) the global mandatory proxy under Ubuntu (not tested elsewhere).
Others keys you can configure :
gconftool-2 --set "/system/http_proxy/host" --type string "
gconftool-2 --set "/system/http_proxy/port" --type int 8080
gconftool-2 --set "/system/http_proxy/ignore_hosts" --type list --list-type string ["localhost","127.0.0.1","*.local"]
gconftool-2 --set "/system/proxy/mode" --type string manual
When you need to work a long time in the same directory, which prompt is of the type:
bob@ubuntu:~/directory1/directory2/directory3/directory4/directory5$
it is better to hide all this with the command PS1='$'
To retrieve a normal prompt, type: PS1='$PWD$ '
watch the seconds of your life tick away - replace YYYY-mm-dd HH:MM:ss w/ your birthtime.
used in an if-then-else in case the default shell is ksh, not bash.
The $(basename ${0#-}) is handy to echo which shell and strip the dash some flavors put in front of "bash"
if [ $(basename ${0#-}) == "bash" ] ; then
export PS1='\[\e]0;\h \u \w\a\]\n\[\e[0;34m\]\u@\h \[\e[33m\]\w\[\e[0;32m\]\n\$ '
else
HOST=`hostname`
ESC=`echo "\033"`
BEL=`echo "\007"`
RAW=`echo "\r"`
export PS1='-${RAW}${ESC}]0;${HOST} ${USER}${BEL}-${ESC}[0;34m${USER}${ESC}[0m@${ESC}[0;34m${HOST%%.*}${ESC}[0;33m${ESC}[0m $ '
fi
this application monitors the apps you use most often and load them into memory with their libraries and other dependencies.
So now, when you launch Firefox or Thunderbird or OpenOffice, the display is immediate as on Mac.
The example will create a directory called "
Caveats: @imports of css files will not be converted.
special thanks to XwZ :)