Quick write some notes to a file with cat. Ctrl+C when you have finish.
This command will nicely dump a filesystem to STDOUT, compress it, encrypt it with the gpg key of your choice, throttle the the data stream to 60kb/s and finally use ssh to copy the contents to an image on a remote machine. Show Sample Output
Usage example:
newest Desktop/*
Replace "-nt" with "-ot" for oldest.
Run
shopt -s dotglob
first to include dotfiles.
The empty file /forcefsck causes the file system check fsck to be run next time you boot up, after which it will be removed.
This works too:
sudo >/forcefsck
The command find search commands with size zero and erase them.
bash2 : for X in $(seq 1 5); do printf "%03g " "$X";done bash3 : for X in {1..5}; do printf "%03g " "$X";done bash4 : echo {001..5} Show Sample Output
empties a file... --- fir3net.com ---
When writing on the command line of zsh, by pressing Alt+q the command will be cleaned, and you can insert another one. The command you were writing will be recorder, and pasted on the prompt immediately after the "interrupting" command is inserted. Show Sample Output
The command find search commands with size zero and erase them.
Useful when you need to write e.g. an INSERT for a table with a large number of columns. This command will retrieve the column names and comma-separate them ready for INSERT INTO(...), removing the last comma.
The original version gives an error, here is the correct output
I took java to make the find command simpler and to state that it works for any language supported by cpp. cpp is the C/C++ preprocessor (interprets macros, removes comments, inserts includes, resolves trigraphs). The -fpreprocessor option tells cpp to assume the input has already been preprocessed so it will only replace comment lines with blank lines. The -L 1 option tells xargs to launch one process for each line, indeed cpp can only process one file at the time...
doesn't need /dev/null Show Sample Output
This will only work on files since ls won't tell the size of a directory contents. Note that the first switch is the digit one, not the letter ell.
If you receives a lot of compiling errors, type 'clear', then reedit your code and press "SHIFT+PGUP". Show Sample Output
If a command returns a error code, you will know Show Sample Output
Easy way to find your computers IP in one place, ie, twitter It suppress the need of dyndns clients and remembering the complex names they give you. I put it inside KAlarm ( the cron GUI for KDE, ubuntu), to update my ip every 3 minutes. I did not add the cron statements to keep the code clean. Show Sample Output
Usage:
mydir=/very/long/path/to/a/dir
cd mydir
I often need to cd where no man wants to go (i.e. long path). by enabling the shell option cdable_vars, I can tell cd to assume the destination is the name of a variable.
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.
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
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: