By default, screen tries to restore its old window sizes when attaching to resizable terminals. This command is the command-line equivalent to typing ^A F to fit an open screen session to the window.
Removes the given string from all files under the given path - in this case the path given is "." This demonstrates the characters that must be escaped for the grep and sed commands to do their work correctly. Very handy for fixing hacked html files.
This will search for "string" in all files under the given path "." and provide a listing of the files with their relative locations. Show Sample Output
This will find all files under the path "." which are older than 10 days, and delete them. If you wish to use the "rm" command instead, replace "-delete" with "-exec rm [options] {} \;"
This will find all files in the path "." which are older than 10*24hrs (10 days). This will find any type of file.
#1 You invoked a command chain. #2 You globaly replace the scriptnames and execute them direct #3 The new executed command chain [# ^foo^bar] would only replace the firts match [foo] with [bar]. Show Sample Output
This command only check the network connection from given eth. This is very useful if you are using more then one interface in your server or laptop. Show Sample Output
This command searches the current directory, and all of its subdirs, for files that have the string "foo" in their filename (foo.c, two-foo.txt, index-FOO-bar.php, etc), and opens them in Vim. It ignores any hidden .svn directories. Change -iname to -name if you want to do case-sensitive matches. Files open in buffers by default, so to verify that the correct files were opened, type ":list". You can load all the files in tabs by doing ":tab ball" or use 'vim -p' on the command-line to load files straight to tabs. If you get permission denied errors, do: vim $(find . ! -path \*.svn\* -type -f iname \*foo\* 2>/dev/null) To narrow it down to a single file extension, such as .php files, use \*foo\*.php (or '*foo*.php'. Which ever you prefer)
Ever gone to a site that has an MP3 embedded into a pesky flash player, but no download link? Well, this one-liner will yank the names of those tunes straight out of FF's cache in a nice, easy to read list. What you do with them after that is *ahem* no concern of mine. ;) Show Sample Output
why make it complicated ? : ] -------------------- I just noticed someone else has posted this on this site before me (sorry I am now a duplicate :/) http://www.commandlinefu.com/commands/view/4313
newly downloaded videos
goyoutube
random
goyoutube rand
This command assumes you've already downloaded some YouTube .mp4 or .flv video files via other means. Requires 'shuf', or your own stdin shuffler.
Scans local area for visible Bluetooth devices. Use 'hcitool inq' to discover the type of device it is. And use -i hciX option to specify the local Bluetooth device to use.
Example:
cat <<EOF >/tmp/foo
5 45
80 35
4 10
80 15
80 10
4 10
5 20
EOF
awk '{a[$1] += $2} END { for (i in a) {print i "=" a[i]}}' /tmp/foo
80=60
4=20
5=65
Check if you have 64bit by looking for "lm" in cpuinfo. lm stands for "long mem". This can also be used without being root.
This command extracts 10 seconds worth of frames, starting from 00:15:45 position, from filename.avi and stores them into out_frames folder as jpeg files. Subtitles are turned off with -sid 999 option.
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.
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
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: