Commands by lasthunter914 (0)

  • bash: commands not found

What's this? 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

Copy a directory recursively without data/files

Dump root ext3 fs over ssh
...can do similar w/ tar, dd, xfsdump, e2fsdump, etc.

List just the executable files (or directories) in current directory
Does an 'ls' on just the files and directories in the current directory with an execute bit turned on. This version will list directories. Just tack on "-type f" to the start of the find to omit listing directories and list only files.

Replace "space" char with "dot" char in current directory file names

Send an email from the terminal when job finishes
Might as well include the status code it exited with so you know right away if it failed or not.

Summary of disk usage, excluding other filesystems, summarised and sorted by size
This command is useful for finding out which directories below the current location use the most space. It is summarised by directory and excludes mounted filesystems. Finally it is sorted by size.

Function to check whether a regular file ends with a newline
tail -c 1 "$1" returns the last byte in the file. Command substitution deletes any trailing newlines, so if the file ended in a newline $(tail -c 1 "$1") is now empty, and the -z test succeeds. However, $a will also be empty for an empty file, so we add -s "$1" to check that the file has a size greater than zero. Finally, -f "$1" checks that the file is a regular file -- not a directory or a socket, etc.

Load your [git-controlled] working files into the vi arglist.
Branch name may be substituted, of course.

Simple addicting bash game.
Really bored during class so I made this... Basically, you hold period (or whatever) and hit enter after a second and you need to make the next line of periods the same length as the previous line... My record was 5 lines of the same length. It's best if you do it one handed with your pointer on period and ring on enter.

vim insert current filename
insert filename Normal mode: "%p Insert mode: %

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.


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: