Commands using readlink (26)

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

Using vim to save and run your python script.
This will save and execute your python script every time your press the F5 function key. It can also be added to your .vimrc: autocmd BufRead *.py nmap :w^M:!python % NOTE: the ^M is not just caret-M, it can be created by type: ctrl-v ctrl-m

Script executes itself on another host with one ssh command
Now put more interesting stuff on the script in replacement of hostname, even entire functions, etc, and stuff. hosta> cat myScript.sh #!/bin/sh [ $1 == "client" ] && hostname || cat $0 | ssh $1 /bin/sh -s client hosta> myScript.sh hostb hostb hosta>

list files recursively by size

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

Generate a GIF image from video file
The 30 means start extracting frames from 30 seconds into the video. The 3 means extract the next 3 seconds from that point. The fps can be adjusted based on your preferences. The 320 is the width of the gif, the height will be calculated automatically. input.mp4 is the video file, which can be any video file ffmpeg supports. The output.gif is the gif created.

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

List files size sorted and print total size in a human readable format without sort, awk and other commands.

Split a large file, without wasting disk space
It's common to want to split up large files and the usual method is to use split(1). If you have a 10GiB file, you'll need 10GiB of free space. Then the OS has to read 10GiB and write 10GiB (usually on the same filesystem). This takes AGES. . The command uses a set of loop block devices to create fake chunks, but without making any changes to the file. This means the file splitting is nearly instantaneous. The example creates a 1GiB file, then splits it into 16 x 64MiB chunks (/dev/loop0 .. loop15). . Note: This isn't a drop-in replacement for using split. The results are block devices. tar and zip won't do what you expect when given block devices. . These commands will work: $ hexdump /dev/loop4 . $ gzip -9 < /dev/loop6 > part6.gz . $ cat /dev/loop10 > /media/usb/part10.bin

search for text in files. recursive.
recursively search dir for a a particular file type, search each file for a particular text.

Boooted as EFI/UEFI or BIOS


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: