Commands using sudo (537)

What's this?

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.

Share Your Commands


Check These Out

Batch rename extension of all files in a folder, in the example from .txt to .md
Batch rename extension of all files in a folder, in the example from .txt to .md mmv most likely must be installed, but is very powerfull when you want to move/copy/append/link multiple files by wildcard patterns.

Count the number of man pages per first character (a-z)
There once was a day I needed this info.

copy from host1 to host2, through your host
Good if only you have access to host1 and host2, but they have no access to your host (so ncat won't work) and they have no direct access to each other.

Rapidly invoke an editor to write a long, complex, or tricky command
Allows you to edit your command using your chosen editor. Works in bash with "set -o vi".

Makes the permissions of file2 the same as file1
same as the chmod example, but should also copy extended access control list attributes. deliberately stolen from: $man setfacl

Remove all hidden files in a directory
Remove all hidden files in a directory excluding current dir . and parent dir .. with .??* that means files with at least two characters.

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Sort the current buffer in vi or vim.
vim 7 or higher has internal sort, too 'sort n' for numbers

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Get the Volume labels all bitlocker volumes had before being encrypted
Get information of volume labels of bitlocker volumes, even if they are encrypted and locked (no access to filesystem, no password provided). Note that the volume labels can have spaces, but only if you name then before encryption. Renaming a bitlocker partition after being encrypted does not have the same effect as doing it before.


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: