Works for most distributions, tested on Ubuntu, Fedora, CentOS, Gentoo, SUSE, RedHat.
Debian and Slackware:
cat /etc/*version
Show Sample Output
fold wraps text at 80 characters wide, and with the -s flag, only causes wrapping to occur between words rather than through them.
Creates a full snapshot of your current vim session, including tabs, open buffers, cursor positions, everything. Can be resumed with vim -S . Useful for those times when you HAVE to close vim, but you don't want to lose all your hard-opened buffers and windows. The ! will cause vim to overwrite the file if it already exists. It is not necessary, but useful if you frequently save to the same file (like session.vim or something).
Symlinks all files in the base directory to the target directory then lists all of the created symlinks.
Notes: * Adjust the find command to your own filters. * The -P flag forces to keep absolute paths in the tarball, so that you can be sure that the exact same file hierarchy will be created on the second machine.
Opens or closes the cdrom device.
Useful to archive files once a day:
cp file file.$(date --iso)
Show Sample Output
Displays a list of all the basic keyboard shortcuts in screen. Show Sample Output
You can then switch from a file to another with ^W^W
This command gives a model information of a computer. Also useful in determining the host is a VM machine or actual physical machine. Show Sample Output
Useful in scripts while you just need an IP address in a variable. Show Sample Output
Deletes thousands of files at one go, I'm not able to recall the exact # of files that rm can delete at one go(apprx. around 7000.)
useful for loops like for i in $(cat list_of_servers); do ssh -q $i hostname; done if there is an unreachable server, you can just press ctrl + \ to skip that server and continue on with the loop
This will show all physically connected SATA (and SCSI) drives on your system. This is particularly useful when troubleshooting hard disks.... or when a mount point seems to be missing. Show Sample Output
Create an ISO Image from a folder and burn it to CD (Os X)
I save this to bin/iptrace and run "iptrace ipaddress" to get the Country, City and State of an ip address using the http://ipadress.com service. I add the following to my script to get a tinyurl of the map as well: URL=`lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep details|awk '{print $2}'` lynx -dump http://tinyurl.com/create.php?url=$URL|grep tinyurl|grep "19. http"|awk '{print $2}'
This will append the output of "command" to whatever file you're currently editing in vim. Who else has good vim tricks? :)
Split File in 19 MB big parts, putting parts together again via cat Nameforpartaa Nameforpartab Nameforpartac >> File Show Sample Output
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: