Commands tagged usaco (1)

  • 1. Get name of task by task=$(basename "$(pwd)") 2. Check whether "$task.c" exists as a file 3. open "$task.c", "$task.in", "task.out" in vim with such layout. ------------------------------- |            | $task.in    | |            |                | |$task.c  |-----------------| |            | $task.out  | |            |                | -------------------------------


    -1
    alias viaco='task="$(basename "$(pwd)")"; if [ -f "$task.c" ]; then vi -c "set mouse=n" -c "set autoread" -c "vsplit $task.out" -c "split $task.in" -c "wincmd l" -c "wincmd H" $task.c; fi'
    yolila · 2011-05-13 13:35:02 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

take a look to command before action
add |sh when you agree the list, I often use that method to prevent typos in dangerous or long operations

Search some text from all files inside a directory

List the Sizes of Folders and Directories
I wanted an easy way to list out the sizes of directories and all of the contents of those directories recursively.

To get the CPU temperature continuously on the desktop
There is no need for variables. I also added sleep to reduce cpu usage, however I didn't test it.

cycle through a 256 colour palette
just for fun

list files recursively by size

rgrep: recursive grep without .svn
Only excludes .svn from filenames.

What is my ip?

shell bash iterate number range with for loop

Show LAN IP with ip(8)
$ ip address show | grep eth0 | sed '1d' | awk '{print $2}' does the same, but shows network-prefix.


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: