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

Generate a list of installed packages on Debian-based systems

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

See system users

start vim in diff mode
vim will open both files side by side and show colored diffs

RELINK a lot of broken symlinks - FIX broken symlinks after rsync site to new server
After you run this script, you can check status for broken symlink with this command: find -L . -type l

Trace a DNS query from root to the authoritive servers.
Simple command to trace a DNS query from the root all the way to the authoritative servers.

Cut/Copy brackets or parentheses on vim (in normal mode)
We have for example : func () { echo FOO echo BAR } Place the cursor under a bracket and press d + %. It will cut everything inside and the brackets. It let : func () You can copy text with y + %

Rename files in batch

Save current layout of top
'top' has fancy layout modes where you can have several windows with different things displayed. You can configure a layout and then save it with 'W'. It will then be restored every time you run top. E.g. to have two colored windows, one sorted by CPU usage, the other by memory usage, run top $ top then press the keys $ and then as you don?t want to repeat this the next time: $

Backup with versioning
Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted. Inspired by EVACopy http://evacopy.sourceforge.net


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: