What's this?

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/

Get involved!

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.

Universal configuration monitoring and system of record for IT.

Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags





Commands tagged KDE from sorted by
Terminal - Commands tagged KDE - 15 results
pkill plasma-desktop && plasma-desktop
2015-09-28 23:36:24
User: lordtoran

This can help with serious GUI lockups in KDE. It will only restart Plasma + widgets, not your session, so all your programs will stay running.

sudo sh -c "rm /usr/share/mime/packages/kde.xml && update-mime-database /usr/share/mime"
dbus-send --system --print-reply --dest="org.freedesktop.login1" /org/freedesktop/login1 org.freedesktop.login1.Manager.Suspend boolean:true
( eval $(grep -z '^DBUS_SESSION_BUS_ADDRESS' /proc/$(pgrep -u $USER plasma-overlay)/environ); export DBUS_SESSION_BUS_ADDRESS; kquitapp plasma-overlay )
2014-09-01 12:49:58
User: mig_hg
Functions: eval export grep

So this first obtains address of the DBUS session, as it's not available by default over SSH. Then it tells plasma-overlay to exit. `kquitapp` is pretty much an equivalent of the qdbus calls.

sudo sed -i 's/Exec=skype %U/Exec=skype --disable-cleanlooks -style GTK %U/' /usr/share/applications/skype.desktop
2013-04-17 08:43:00
User: FadeMind
Functions: sed sudo

Replace default command in skype.desktop file.

qdbus org.kde.ksmserver /KSMServer logout 0 2 2
2012-03-12 19:48:08
User: Aissen
Tags: KDE session halt

Allows system to be halted and session closed by KDE. Very useful to save applications states, especially with the KDE apps that behave correctly.

qdbus org.freedesktop.PowerManagement /org/kde/Solid/PowerManagement suspendToRam
xdg-open [path]
2010-06-30 07:32:53
User: infinull
Tags: KDE gnome

open [path] in the default program, regardless of which Desktop Environment you use (KDE, GNOME, etc.)

Works on all "freedesktop.org" compatible desktop environments

kbuildsycoca4 && kquitapp plasma-desktop && kstart plasma-desktop
2010-02-19 06:37:41
User: freethinker
Tags: KDE plasma

Quit Kill Restart Plasma whenever it is hung!

qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
2010-01-26 17:50:10
User: starchox

If you wish to launch the kde4 screen saver without the password prompt to exit, use this command:

qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SetActive True

Also can be done with:

/usr/lib/kde4/libexec/kscreenlocker --forcelock
qdbus org.kde.screenlocker /MainApplication quit
2009-08-27 13:57:00
User: Alanceil

The unlock command for KDE 4.3 has changed from krunner_lock, this process doesn't exist anymore. So here's the update :-)

If qdbus complains about not being able to find X, put a "DISPLAY=:0 " (:0 being your X server display) in front of the command.

skype --disable-cleanlooks -style GTK
2009-07-23 22:55:09
User: Paaskehare

I use this to make skype blend better into my desktop :)

--disable-cleanlooks might not be nescessary to achieve the wanted effect.

TMPROOT=/tmp; TMPDIR=$(mktemp -d $TMPROOT/somedir.XXXXXX); TMPFILE=$(mktemp $TMPROOT/somefile.XXXXXX); trap "rm -rf $TMPDIR $TMPFILE; exit" INT TERM EXIT; some treatment using $TMPDIR and $TMPFILE; exit 0
2009-02-24 09:35:22
User: raphink
Functions: exit mktemp trap

Cleanly create tempfiles using mktemp and remove them using traps instead of removing them in the end of the script. This way, you make sure the tempfiles are removed properly even if the script is killed or interrupted.

For a user script in KDE4, you can set TMPROOT using :

TMPROOT=$(kde4-config --path tmp)
kquitapp plasma
2009-02-16 21:27:16
User: raphink
Tags: KDE

KDE4 is great, but still a bit buggy, and sometimes plasma requires to be restarted. Instead of quitting it with "killall plasma", which might loose your preferences (widgets, etc.), kquitapp will cleanly quit it. Tip: you can type this in the "Alt+F2" window, and then type "plasma" in Alt+F2 again to restart plasma (be patient though...).

kdialog --passivepopup <text> <timeout>
2009-02-16 15:09:27
User: raphink
Tags: KDE

Display a passive popup during seconds. Additionnaly, --title can be used to set the title of the popup. This is a nice way to communicate with a desktop user of a machine you have an SSH access on :

DISPLAY=:0 sudo -u $user -H kdialog --passivepopup "Hello you" 10 --title "cli IM"