When your ssh session hanged (probably due to some network issues) you can "kill" it by hitting those 3 keys instead of closing the entire terminal.
eg:
printTextInColorRed foo bar
foo bar [in red color]
Linux offers an interesting option to restrict the use of dmesg. It is available via /proc/sys/kernel/dmesg_restrict.
You can check the status with:
cat /proc/sys/kernel/dmesg_restrict
Alternatively you can use sysctl:
sudo sysctl -w kernel.dmesg_restrict=1
To make your change persistent across reboot, edit a fille in /etc/sysctl.d/.
Not really alternative, just giving a different behavior listing current directory if no directory given.
This command is almost the same as 'ls -a', but it does not display the current dir (.) or parent (..)
Change the file location in the second half of the string to the exact file location of your chosen picture.
In Mac OS X, by default, you have to click the mouse on a Terminal window before you can type in it. You can change this behavior to mimic the X11 behavior of focusing on the window on mouseover.
This will change your terminal foreground colour.Depending on the system, tput uses the terminfo or termcap database, as well as looking into the environment for the terminal type. You can use "setb" to set terminal background colour
It starts in the current working directory.
It removes the empty directory and its ancestors (unless the ancestor contains other elements than the empty directory itself).
It will print a failure message for every directory that isn't empty.
This command handles correctly directory names containing single or double quotes, spaces or newlines.
If you do not want only to remove all the ancestors, just use:
find . -empty -type d -print0 | xargs -0 rmdir
# AllInOne: Update what packages are available, upgrade to new versions, remove unneeded packages # (some are no longer needed, replaced by the ones from ap upgrade), check for dependencies # and clean local cached packages (saved on disk but not installed?,some are needed? [this only cleans unneeded unlike ap clean]). # aliases (copy into ~/.bashrc file): alias a='alias' a ap='apt-get' a r='ap autoremove -y' a up='ap update' a u='up && ap upgrade -y --show-progress && r && ap check && ap autoclean' # && means "and run if the previous succeeded", you can change it to ; to "run even if previous failed". I'm not sure if ap check should be before or after ap upgrade -y, you can also change the alias names. # To expand aliases in bash use ctrl alt e or see this ow.ly/zBKHs # For more useful aliases go to ow.ly/zBMOx
Rainbow Stream is a smart and nice Twitter client on terminal. Almost everything you can do with a GUI application can be done, even viewing an image. - Tab-autocomplete, history browsing - Beautiful built-in themes and custom configuration support - Tweet's images directly on your terminal. Show Sample Output
Allows you to have a list of the domains on the server.
Easiest way to get the external IP address.
http://ifconfig.me is a web site which shows your public iP address. If you want use your own code, you can use PHP code such as: function getip() { return "".$_SERVER["REMOTE_ADDR"]; } echo getip(); ?> Then, you'll get your IP by 'curl yourfile.php'. Show Sample Output
With many distro if a laptop will be running on batteries, the settings of the power management utility try to optimize the performance and behavior to increase battery life. Very often happens that the default settings are too aggressive and cause continuous Hdd spindown with the risk of damage. This command turns hdd power management off.
The command lets you know the status of the Caps, Num and Scroll Lock in the terminal. This is useful when the Netbook has no LED indicators Show Sample Output
Opens the appropriate graphical file browser for the current terminal eg nautlius.
Basically, \033[ is a semi-portable unix escape character. It should work in linux, osx, bsd, etc. The first option is 38. This tells whatever is interpreting this (and this is merely convention) that a special color sequence follows. The next option is 5 which says that the next option will specify a color ? {0..256} of course. These options, as you can see, are separated by a single `;` and the entire escape sequence is followed by a mandatory `m`. The second escape sequence (following "COLOR") is simply to clear all terminal attributes (for our purposes, it clears color). This for loop is helpful for testing all 256 colors in a 256 console (note: this will not work in a standard Linux tty console) or to see which number corresponds to which color so that perhaps you can use it! Show Sample Output
Use duckduckgo from terminal:
ddg commandline one liners
Want Google instead? :P
lmgtfy(){ ARGS="$@"; xdg-open "http://www.lmgtfy.com/?q=${ARGS}#"; }
lmgtfy "What the f*** is lmgtfy?"
Or just:
google(){ ARGS="$@"; xdg-open "https://www.gooogle.com/search?q=${ARGS}"; }
google Please Google, take my soul
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: