Commands using ls (517)

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 search in man files or bz-files by keyword direct by man or bz files
For example we need find fast where located and described keyword COMMIT_EDITMSG in man files. Here example howto solve it by search with command bzgrep in man files. Generally these files in bz compressed format. You can use another keywords to your search. Common syntax is: bzgrep -lE keyword1 /usr/share/man/man?/optional-keyword-to-refine* or bzgrep -lE keyword1 /usr/share/man/man?/* where optional-keyword-to-refine is optional and may be omitted but used to speedup search Of course you may combine other options for bzgrep (its based on grep)

leave a stale ssh session
When your ssh session hanged (probably due to some network issues) you can "kill" it by hitting those 3 keys instead of closing the entire terminal.

Run command in an ftp session
By putting ! in front of a command, we are able to run it from an ftp session.

Generate a random password 30 characters long
This command is similar to the alternate, except with head(1), you can pick as many passwords as you wish to generate by changing the number of lines you wish to preview.

Show drive names next to their full serial number (and disk info)

Copy a directory recursively without data/files

Using json.tool from the shell to validate and pretty-print

ignore the .svn directory in filename completion
When browsing java source code (for example) it's really annoying having to type the first letter of the package when there is only one package in the subdir. man bash for more info about FIGNORE

Check disk for bad sectors
Checks HDD for bad sectors, just like scandisk or chkdisk under some other operating system ;-).

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested


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: