Commands tagged sort (176)

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

Fast file backup
This is a BASH feature. The above command will create a backup of "filename" called "filename.DATE", where DATE is the actual day in %Y%m%d (year, month and day numbers together) format.

Displays the current time using HTTP
This command will show the current GMT time using HTTP. This might be useful if you just want to know what's the current human-readable and accurate-enough time, without changing the system time, using a simple command that would work regardless of the availability of NTP. Note: To get a quicker and more accurate response, replace google.com with your local NTP server. Also can be used as an alternative to the "htpdate" program: http://www.commandlinefu.com/commands/view/668/set-your-computers-clock-using-http-and-htp-http-time-protocol-when-ntpsntp-is-not-available

List all global top level modles, then remove ALL npm packages with xargs

check open ports without netstat or lsof

uniq without pre-sorting
Reads stdin, and outputs each line only once - without sorting ahead of time. This does use more memory than your system's sort utility.

List all Windows services on the command line
On Windows 2000 or later, this command will give a listing of all the registered Windows services. You can then know what the name of a command is in order to start and stop it. e.g. $ sc start Apache2.2 or $ net start Apache2.2 Please note that sc will allow the SERVICE_NAME only, while net will allow both SERVICE_NAME and DISPLAY_NAME. Note that the space between the = and the next word are important. Not very unixy, that. http://www.ss64.com/nt/sc.html http://www.ss64.com/nt/net_service.html http://technet.microsoft.com/en-us/library/bb490995.aspx

validate the syntax of a perl-compatible regular expression
Place the regular expression you want to validate between the forward slashes in the eval block.

[vim] Clear trailing whitespace in file
% acts on every line in the file. \s matches spaces. \+ matches one or more occurrences of what's right behind it. Character '$' matches end-of-line.

Count Files in a Directory with Wildcards.
Remove the '-maxdepth 1' option if you want to count in directories as well

Sort a one-per-line list of email address, weeding out duplicates


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: