Commands tagged 32 (4)

  • bash: commands not found

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

Show line numbers in a text file

Grab IP address on machine with multiple interfaces
Instead of hard-coding in a check to scrape info from ifconfig based on a specific interface, do it in a more portable way. This works really well if you switch between wired, wireless, bluetooth or even VPN connections. You can get your current IP in a script (since it'll be something like tun0 instead of eth0 or wlan1). This uses a well known public ip address 8.8.8.8, but it doesn't actually connect to it, it just shows you the route it would take.

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

Remove invalid host keys from ~/.ssh/known_hosts
Useful if you have to tunnel ssh through a local port and it complains of the host key being different. Much easier than manually editing the file.

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"

rename all jpg files with a prefix and a counter

Kill any lingering ssh processes

Test speaker channels
Useful tool to test if all speaker channels are working properly. speaker-test is part of alsa-utils package

Count the number of queries to a MySQL server

backup your history
simple and easy backup your history with timestamp


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: