Commands using cat (502)

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

Batch file name renaming (copying or moving) w/ glob matching.

Get current Xorg resolution via xrandr
Not sure if it works the same on any shell.

Prepend a text to a file.
Using the sed -i (inline), you can replace the beginning of the first line of a file without redirecting the output to a temporary location.

intercept stdout/stderr of another process or disowned process
Useful to recover a output(stdout and stderr) "disown"ed or "nohup"ep process of other instance of ssh. With the others options the stdout / stderr is intercepted, but only the first n chars. This way we can recover ALL text of stdout or stderr

backup local MySQL database into a folder and removes older then 5 days backups

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Cut the first 'N' characters of a line
You can also cut charactes starting from X to N.

find and delete empty dirs, start in current working dir

Display 6 largest installed RPMs sorted by size (descending)
Low on disk space? Check the largest installed RPMs for delete canditates.

Random number generation within a range N, here N=10


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: