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:
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.
Works 99.9% of the time; so far never required a more complex expression in manual input.
Although rm is protected against it, there are many commands that would wreak havoc on entering the obvious ".*" to address "dot-files". This sweet little expression excludes the dirs "." and ".." that cause the problems.
I find the ouput of ls -lR to be un-satisfying (why is the path data up there?) and find syntax to be awkward. Running 'du -a' means you will have likely to trim-off filesize data before feeding filenames to the next step in the pipe.