Commands by bassiek (1)

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

Open Remote Desktop (RDP) from command line and connect local resources
The above command will open a Remote Desktop connection from command line, authenticate using default username and password (great for virtual machines; in the exampe above it's administrator:password), create a shared folder between your machine and the other machine and configure resolution to best fit your desktop (I don't like full screen because it make the desktop panels to disappear). The command will run in the background, and expect to receive parameters. You should enter hostname or IP address as a parameter to the command, and can also override the defaults parameters with your own.

Download all videos in your Boxee queue
Gets all videos in your boxee queue with a URL associated with them and attempts to download each using get_flash_videos

Copy/move a bunch of files to dot files and back

Show last changed files in a directory
This will quickly display files last changed in a directory, with the newest on top.

resize all JPG images in folder and create new images (w/o overwriting)
Convert all jpegs in the current directory into ~1024*768 pixels and ~ 150 KBytes jpegs

Use a var with more text only if it exists
See "Parameter Expansion" in the bash manpage. They refer to this as "Use Alternate Value", but we're including the var in the at alternative.

Create directory named after current date
Not a discovery but a useful one nontheless. In the above example date format is 'yyyymmdd'. For other possible formats see 'man date'. This command can be also very convenient when aliased to some meaningful name: $ alias mkdd='mkdir $(date +%Y%m%d)'

get header and footer of file for use with scalpel file carving
file carving helps if you know where the file you are looking for starts and ends. It's also an easy way to get data and catalog them for future use with forensic tools like scalpel.

Google Spell Checker
http://immike.net/blog/2007/04/07/hacking-google-spell-checker-for-fun-and-profit/

Know SELinux status
Usefule to check whether SELinux is in force or disabled. Though you need to be superuser while execute this command.


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: