The variable ? contain the last exit status of a command, it can be printed for troubleshooting purpose. Show Sample Output
I use this simple command for remove all backup files generated usually by editors like Vim and Emacs.
During this operation : # mv Joomla_1.5.10-Stable-Full_Package.zip /var/www/joomla/ I invoke /var/www/joomla/ as last command argument. To change in this directory I can use # cd !$ So I go to hob:/var/www/joomla#
Assuming that 219,229 and 221 are entries in history, I recall them in a single line for execute multiple commands 219 ifdown wlan0 ... 221 ifup wlan0 ... 229 iwconfig wlan0 mode Managed so the result is execution of # ifdown wlan0 ; iwconfig wlan0 mode Managed ; ifup wlan0
tailf same as tail -f follow the flow of a log file, showing it in real time to stdout.
Aureport is a tool for displaying auditd system log. -x options cause to display launched executable on system. Aureport work with auditd so auditd must be installed an running on a system. Tested on CentOS / Debian Show Sample Output
Simple but useful command, I use this for purge an hard disk entry in Virtualbox registry file (is in ~user/.Virtualbox) that persist if I erase a Virtual Machine, so I need to delete it manually.
G option cause a file to be spacing line by line. Show Sample Output
Umask is obtained subtracting 7 from each cypher of octal format. I store octal perm format in an array,then for each element of array I subtract 7. The result is the umask. Show Sample Output
I use this for connect via sftp to a server listening on a non default ssh port.
ifstat, part of ifstat package, is a tool for displaying bandwidth and other statistics. The -n option avoid to display header periodically, the -t option put a timestamp at the beginning of the line. Works for me on Debian and CentOS Show Sample Output
If histappend options is set in bash, the file .bash_history will not be overwrite and history list is append to it.
pinfo package provide a nice info alternative based on ncurses.
Works on CentOS ad OpenBSD too, display time of accounts connection on a system, -p option print individual user's statistics. Show Sample Output
Lam is a command available on Bsd (I've tested it on OpenBSD).Is useful for laminate a file line by line. The -f option set the field width ( -f min.max ). Show Sample Output
Lndir create from source directory to destination directory a full symlink tree of all contents of source directory, really useful for propagate changes from a directory to another.
Look search for lines in a file that beginning with a given string. Same as $ grep ^n /etc/passwd Show Sample Output
This is useful for remove all packages that are part of a common suite.
I have often file like this 01 - file.file 02 - file.file 03 - file.file I rename all with this command for f in * ; do mv -- "$f" "${f/[0-9][0-9] \- /}" ; done then it looks like this file.file file.file file.file etc
Nicely display permissions in octal format and filename for a given directory Show Sample Output
Execute a command on shell logout,and run it until is finished,then shell is closed.
Suppose that you had change in a directory like /home/user/mycode/code, and now you need to list it, instead of type entire path again, use ls !$ to recall path and list. Useful with many commands, this is only an example. (In this case, same result can be achivied with ls .)
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: