Prints an easy-to-copy color code for each color. Show Sample Output
-c will count the number of times your search matches in the file. Show Sample Output
entering this command as root may give more complete results, creating a tmp file, and immediately opening the file might be more useful
if you want to look php version on linux Show Sample Output
By this command you can take the snapshot of you harddisk (full) and create the image , the image will be directly store on remote server through ssh. Here i am creating the image of /dev/hda and saving it at 4.2.2.2 as /root/server.img.
This is much easier to parse and do something else with (eg: automagically create ZFS vols) than anything else I've found. It also helps me keep track of which disks are which, for example, when I want to replace a disk, or image headers in different scenarios. Being able to match a disk to the kernels mapping of said drive the disks serial number is very helpful
ls -l /dev/disk/by-id
Normal `ls` command to list contents of /dev/disk/by-id
grep -v "wwn-"
Perform an inverse search - that is, only output non-matches to the pattern 'wwn-'
egrep "[a-zA-Z]{3}$"
A regex grep, looking for three letters and the end of a line (to filter out fluff)
sed 's/\.\.\/\.\.\///'
Utilize sed (stream editor) to remove all occurrences of "../../"
sed -E 's/.*[0-9]{2}:[0-9]{2}\s//'
Strip out all user and permission fluff. The -E option lets us use extended (modern) regex notation (larger control set)
sed -E 's/->\ //'
Strip out ascii arrows "-> "
sort -k2
Sort the resulting information alphabetically, on column 2 (the disk letters)
awk '{print $2,$1}'
Swap the order of the columns so it's easier to read/utilize output from
sed 's/\s/\t/'
Replace the space between the two columns with a tab character, making the output more friendly
For large ZFS pools, this made creating my vdevs immeasurably easy. By keeping track of which disks were in which slot (spreadsheet) via their serial numbers, I was able to then create my vols simply by copying and pasting the full output of the disk (not the letter) and pasting it into my command. Thereby allowing me to know exactly which disk, in which slot, was going into the vdev. Example command below.
zpool create tank raidz2 -o ashift=12 ata-... ata-... ata-... ata-... ata-... ata-...
Show Sample Output
Resume incomplete youtube-dl video files. Assuming mp4 format here.
(Tested on LibreElec8 and Openelec8)
Changes files like "temp (2).txt" to "temp.txt". Does not overwrite files that already exist.
untar in place with out creating a temporary file
convert -resize 750?500 -quality 80% *.jpg These are command-line invocations of ImageMagick functions. The first sizes an image file to 40% of original and saves it to a different name, while the second makes all jpg files in a directory sized to 750x500 pixels. Such a pleasure not to need to point and click to make a bunch of thumbnails -- for example.
Convert comma separated files to tab separated files. (MySQL eats tab separated files with much less instruction than comma seperated files.) Show Sample Output
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server.
This command adds a urpmi media source called "google-talkplugin" to the urpmi configuration on Mandriva or Mageia. Needs to be run as root. We specify the option "--update" so that when Google provides a newer version of Google Talk plugin in their download system then running a system update (eg: "urpmi --auto-update") will result in our copy of Google Talk plugin getting updated (along with any other Mandriva/Mageia pending updates). To install Google Talk plugin from this source, use: urpmi google-talkplugin # install plugin used for voice and video Google chat via gmail Show Sample Output
It remove the square bracket and convert UNIX time to human readable time for all line of a stream (or file). Show Sample Output
This uses the KDE suspend to ram.
Create a bash function for easy reference webPassword() { echo $1 $2 | md5sum | awk '{print substr($0,0,10)}' } alias webpwd=webPassword Use like this. webpwd www.commandlinefu.com MyPetNameHere 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: