When typing out long arguments, such as:
cp file.txt /var/www/wp-content/uploads/2009/03/
You can put that argument on your command line by holding down the ALT key and pressing the period '.' or by pressing <ESC> then the period '.'. For example:
cd 'ALT+.'
would put '/var/www/wp-content/uploads/2009/03/ as my argument. Keeping pressing 'ALT+.' to cycle through arguments of your commands starting from most recent to oldest. This can save a ton of typing.
Just type 'opened' and get all files currently opened for edit.
By 'pst' you can print out process tree with all details about all processes (including a command line, PID, and the current process you are running in). By 'pst username' you can get an information about processes belonging to the particular user 'username'. Show Sample Output
Alias two dots to move to parent directory. Put it into your .bashrc or .profile file. Show Sample Output
It helps you save a lot of writing :-) Show Sample Output
I think it would be wise if anyone voting down left a comment indicating the reason for that action. Don't keep it to yourself. Thanks. Show Sample Output
The output of "echo $PATH" is hard to read, this is much easier. The parentheses ensure that the change to the input field separator (IFS) only happens the the sub shell and not affecting the current shell. Show Sample Output
On my music directory, I create variable that contains all mp3s files, then I play them with mpg123. -C options enable terminal control key, s for stop, p for pause, f for forward to next song.
I am new to linux, and I was trying to figure out why I could not sudo with my username in Fedora 10. This command, when run as root, will add a line to the sudoers file allowing the loginname supplied to sudo. The above line will require a password when you sudo, if you wish to sudo without password, use: echo 'loginname ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers instead. you have to run this command as su, and this is just an easier way of using visudo, just adds it right from the terminal.
Mandriva Linux includes a security tool called "msec" (configurable via "draksec"). One of the many things it regularily checks for is world writeable files. If any are found, it writes the list to /var/log/security/writable.today. "wc -l" simply counts the number of lines in the file. This number should be low. Browse through /var/log/security/writable.today and consider if any of those files *need* to be world-writeable (and if not, modify the permissions. eg: "chmod o-w $file"). A large number of world-writeable files may indicate that umask is not correctly set in /etc/profile (or ${HOME}/.bash_profile) but could also indicate poor security configuration or even malicious activity. Show Sample Output
prerequisite:
mkdir ~/journal
It colors the machine name and current directory different colors for easy viewing.
Decreasing the cdrom device speed may be more comfortable to watch films (for example)
Issues a scan command on the given scsi host adapter (ex. a fibre channel adapter, in the example above on host0). Output can be watched in the messages log or in "dmesg"
Lists all installed RPM packages with name and architecture, which is useful to check for compability packages (+ required i386 packages) on a 64bit system. Show Sample Output
Resets a scrambled terminal into its orignal state.
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: