Commands tagged delete (34)

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

Insert a line at the top of a text file without sed or awk or bash loops
Just use '-' to use STDIN as an additional input to 'cat'

Delete all empty lines from a file with vim
This command delete all the empty lines (include the lines with space) from a file. g = global command \S = non-whitespace character; !\S the opposite d = delete a range

add all files not under version control to repository
This should handle whitespaces well and will not get confused if your filenames have "?" in them

ssh autocomplete
Autocomplete from .ssh/config

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Mirror the NASA Astronomy Picture of the Day Archive
Mirror the entire NASA Astronomy Picture of the Day archive, all the way from 1995. The archive is close to 2.5 GB, with lots of files, so give it some time. The logs can be redirected to a file using '-o somefile'. You might also want to try '-nH' and the '--cut-dirs' options

git log with color and path
Cool alias that show a a better Git log

Show git branches by date - useful for showing active branches
This fixes a bug found in the other scripts which fail when a branch has the same name as a file or directory in the current directory.

Delete files older than..
This command will delete files i a given path (/dir_name) , which older than given time in days (-mtime +5 will delete files older than five days.

diff two sorted files
Sees if two records differ in their entries, irrespective of order.


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: