Only requirement is bash shell. No functions needed. Show Sample Output
This keeps the user logged in but shows the login screen. Very useful when connecting remotely to an OSX-Server via VNC
I don't like doing a massive sort on all the directory names just to get a small set of them. the above shows a sorted list of all directories over 1GB. use head as well if you want. du's "-x" flag limits this to one file system. That's mostly useful when you run it on "/" but don't want "/proc" and "/dev" and so forth. Remember though that it will also exclude "/home" or "/var" if those are separate partitions. the "-a" option is often useful too, for listing large files as well as large directories. Might be slower.
This command removes and then cvs removes all files in the current directory recursively.
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
Use the command line to log into Dropbox. You have to replace me@yahoo.com with your Dropbox email (note the URL-encoding of "@" as %40). Also replace my_passwd with your Dropbox password. (Note: special characters in your password (such as #) must be url-encoded. You will get a cookie (stored in file "cookie") that you can use for subsequent curl operations to dropbox, for example curl -b cookie https://www.dropbox.com/home. Debug note: If you want to see what data curl posts, use curl's --trace-ascii flag. Show Sample Output
This shows all process (-e) and threads (-L) in full format (-F) Show Sample Output
RU: Найдет число файлов в папке по данной маске в цикле по дням месяца
Requires ImageMagick. Extracts date taken from image and renames it properly. Based on StackOverflow answer. Show Sample Output
Replace
'/tmp/file 1.txt' '/tmp/file 2.jpg'
with
"$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
for Nautilus script
Or with
%F
for Thunar action
If you linking the symlinks itself, but want to link to source files instead of symlinks, use
"`readlink -m "$i"`"
instead of
"$i"
like this:
for i in '/tmp/file 1.txt' '/tmp/file 2.jpg'; do ln -s "`readlink -m "$i"`" "$i LINK"; done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Show Sample Output
Piping ps into grep is mostly useless: ps has its own filter options like -u and -C Show Sample Output
use the shell default positional parameter syntax ${X:-default} in lieu of testing.
If you want avoid to be annoyed when playing your favourite video files with your video player, first run this command to stash wrong files (and test tricks to play these wrong files). Show Sample Output
set BLOCK to "title" or any other HTML / RSS / XML tag and curl URL to get everything in-between e.g. some text
This gets the Nth argument in the last line of your history file. This is useful where history is being written after each command, and you want to use arguments from the previous command in the current command, such as when doing copies/moving directories etc. I wrote this after getting irritated with having to continually type in long paths/arguments. You could also use $_ if all you want is the last argument. Show Sample Output
This script can be used to download enclosed files from a RSS feed. For example, it can be used to download mp3 files from a podcasts RSS feed. Show Sample Output
"git grep" automatically excludes untracked files (e.g. compiler output) and files under .git directory. If no directory or file is given, it will recursively search through the current directory.
Randomly remaps the first 5 mouse buttons (left, middle, right, upscroll, downscroll) in X for some reasonably harmless trolling. Non-persistant unless added to ~/.xinitrc or similar. The 'shuf' command is present on most modern desktop distros. To reverse use xmodmap -e "pointer = 1 2 3 4 5"
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: