Commands using hwclock (3)

What's this?

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.

Share Your Commands


Check These Out

Run a command that has been aliased without the alias
Most distributions alias cp to 'cp -i', which means when you attempt to copy into a directory that already contains the file, cp will prompt to overwrite. A great default to have, but when you mean to overwrite thousands of files, you don't want to sit there hitting [y] then [enter] thousands of times. Enter the backslash. It runs the command unaliased, so as in the example, cp will happily overwrite existing files much in the way mv works.

Convert text to picture
generates a picture file with the text. Some other samples in: http://www.imagemagick.org/Usage/text/

determine if tcp port is open
Requires netcat.

remove the last of all html files in a directory
sed can be used deleting the last line and with -i option, there's no need to for temp files, the change is made on the actual file

Look for English words in /dev/urandom
Little faster alternative.

list offsets from HEAD with git log.

perl one-liner to get the current week number
Not perl but shorter.

Edit a PDF's metadata using exiftool
Edit the pdf file foo.pdf's metadata. -overwrite_original overwrites the original file (w/o it exiftool creates a new file)

Symlink all files from a base directory to a target directory
Symlinks all files in the base directory to the target directory then lists all of the created symlinks.

power off system in X hours form the current time, here X=2


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: