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:
This command lists extended information about files, i.e. whether or not it is a true file or link, who owns it, etc. without having to 'ls' from the specific directory. If you know the filename, but not the location, this helps with finding other information about the file. It can be truncated by creating an alias for 'ls -l'. The sample output shows difference in regular locate vs. ls + locate.
This command lists the names of your USB devices connected and what file in /dev they are using. It's pretty useful if you don't have an automount option in your desktop or you don't have any graphical enviroment.
Many competing commands to do this, but since most people want a Long list with Human readable files sizes and want to see All files (including hidden (.*) files) this one wins on simplicity and usefulness. Plus grep is just as, if not more portable than sed or awk, and is more widely understood. :)
ls -l may vary depending on operating system, so "print $8" may have to be changed
For this example, all files in the current directory that end in '.xml.skippy' will have the '.skippy' removed from their names.
Must have the video open and fully loaded.
This is useful for paging through long directories, mulitple directories, etc. I put this in my ~/.bash_aliases file and alias 'lsl' to it.
it does provide much more information , the owner , group , the size in byte , and the last modified time a file or directory was
ls -al : list all in long format
trying to copy all your dotfiles from one location to another, this may help
This will only work on files since ls won't tell the size of a directory contents.
Note that the first switch is the digit one, not the letter ell.
Can easily be scripted in order to show permission "tree" from any folder. Can also be formated with
column -t
{ pushd .> /dev/null; cd /; for d in `echo $OLDPWD | sed -e 's/\// /g'`; do cd $d; echo -n "$d "; ls -ld .; done; popd >/dev/null ; } | column -t
from http://www.commandlinefu.com/commands/view/3731/using-column-to-format-a-directory-listing
plays with bash arrays. instead of storing the list of files in a temp file, this stores the list in ram, retrieves the last element in the array (the last html file), then removes it.
-d: list directory entries instead of contents, and do not dereference symbolic links
No need for -l and the output can be sent directly into another function expecting directory names.
Comments can be used directly on the command line so I can save in the history a brief description of what command does.
List files and pass to openssl to calculate the hash for each file.