commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Find all files in SVN workspace directories which are uncommitted. List them and find their properties
forgot to use a pv or rsync and want to know how much has been copied.
Provides a recursive time ordered list of the current directory over the last 3 minutes.
Excluding zero byte files:
ls -lF -darth `find . -size +0 -mmin -3`
For the last day's files, change "-mmin -3" to "-mtime -1":
ls -lF -darth `find . -size +0 -mtime -1`
shows you the symlinks in the current directory, recursively, but without following them
xargs will automatically determine how namy args are too many and only pass a reasonable number of them at a time. In the example, 500,002 file names were split across 26 instantiations of the command "echo".
Very quick! Based only on the content sizes and the character counts of filenames. If both numbers are equal then two (or more) directories seem to be most likely identical.
if in doubt apply:
diff -rq path_to_dir1 path_to_dir2
AWK function taken from here:
displays a list of all file extensions in current directory and how many files there are of each type of extension in ascending order (case insensitive)
Sometimes there are just no variables such as $DESKTOP_SESSION, $GDMSESSION, or $WINDOWMANAGER.
Old drive with lots of music or unsorted drive? This command will play all mp3 files in a folder and after playing one song or pressing q, it will ask you if you want to delete the file.
You can omit the -d to see what's inside directories. In that case, you may want -a to see dotfiles inside those directories. (Otherwise you don't need -a since you're explicitly looking at them.)
alias lst="ls -ls -tr | tail"
Find all files larger than 500M in home directory and print them ordered by size with full info about each file.
This one works without an external program (watch). Witch is not await able all the time. HINT: use CTRL + C to exit the loop.
This command will delete all files and folders except 'skipme'. it could be a file or a folder.
Use this command if you want to control the size of the files in human readable, every one second.