Uses bash shortcut to generate series, it works with letters too
echo {A..H}
echo {a..h}
Be careful not to mix upper and lower case, you may encounter funny results :
echo {z..A}
z y x w v u t s r q p o n m l k j i h g f e d c b a ` _ ^ ] [ Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
Show Sample Output
needs cwebp
/macos/mojave shell script to change terminal profiles
check web server port 80 response header Show Sample Output
Print a random number between 1 and 50 with a normal distribution around the center. The numbers around the middle are the most likely to occur and the farther you get from that the less and less common they are. You can test this and observe the number distribution with this command:
for i in `seq 100000`; do echo $[(${RANDOM}%40+${RANDOM}%40)/2+1]; done | sort -n | uniq -c
Show Sample Output
I use it after a clean CentOS 7 minimal server installation to automatically populate the /etc/hosts file. Not sure why the installation does not add this entry by itself. Tested on CentOS 7 with the simplest use case: 1 static ip address and the hostname provided during installation. Show Sample Output
to test check if given variable is a digit / number Show Sample Output
Just an alternative for `acpi -b` Show Sample Output
Python is installed on many boxes (in case you could not afford installing jq).
List SAN Domains for a certificate Show Sample Output
It his example removes ' dog', last space included. Show Sample Output
Clear Cached Memory on Ubuntu based distributions, and also display memory status. Please do not use this on a production machine unless you really really know what you are doing. Echo 3 is a kinder way of purging the memory, you can also use 'echo 2' or 'echo 1' if #1 You know what you are doing, and #2 refer to number 1 :-)
Useful when you wait for a server to boot up.
Replace sed regular expressions with perl patterns on the command line. The sed equivalent is: echo "sed -e"|sed -e 's/sed -e/perl -pe/' Show Sample Output
This one-liner outputs a random number between the values given for FLOOR and RANGE. Show Sample Output
This runs a command continuously, restarting it if it exits. Sort of a poor man's daemontools. Useful for running servers from the command line instead of inittab.
Here $HOME/shots must exist and have appropriate access rights and sitecopy must be correctly set up to upload new screen shots to the remote site. Example .sitecopyrc (for illustration purposes only) site shots server ftp.example.com username user password antabakadesuka local /home/penpen/shots remote public_html/shots permissions ignore The command uses scrot to create a screen shot, moves it to the screen shot directory, uploads it using screen uses xsel to copy the URL to the paste buffer (so that you can paste it with a middle click) and finally uses feh to display a preview of the screen shot. Note that $BASE stands for the base URL for the screen shots on the remote server, replace it by the actual location; in the example http://www.example.com/~user/shots would be fitting. Assign this command to a key combination or an icon in whatever panel you use. Show Sample Output
Quick and easy way of validating a date format of yyyy-mm-dd and returning a boolean, the regex can easily be upgraded to handle "in betweens" for mm dd or to validate other types of strings, ex. ip address. Boolean output could easily be piped into a condition for a more complete one-liner.
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: