find -name "*.svn" -exec rm {} \;
Delete all files and directories matching a certain wildcard, here I use "*.svn", from the current directory and below. This particular command will also remove your svn working directory and turn it into a directory free of .svn files, similar to what the directory would be if you use 'svn export'.
ls -lhart
ls 'long style' with human readable file sizes, showing all files, sorted by last modified date to show the most recently modified file at the bottom of the list. Try it.
. ~/.bash_profile
This simple dot before the shell script will execute the following file in the context of the current shell, so all variables will be saved in this shell instance.
> /tmp/blank
Create an empty file at /tmp/blank . It is identical to touch /tmp/blank but is an easier to remember mnemonic.
history
Show previous commands numbered from first to last
history | grep ssh
Show all instances of you connecting through ssh in your history.
!!
Repeat the last command in your history. Yes that is just '!!'. I can't post it as a code snippet for some reason.
!167
Repeat the 167th command in your history.
grep -ri <function name> .
Find all references to <function name> in files in the current directory and below, with a case insensitive match.
find . | grep -i <search>
Find all files and directories under the current directory with a case insensitive match on <search>. Useful if you don't really know what you're looking for, and you have only a phrase to go on. It's fast too.
sudo !!
Repeat the last command, except using sudo. Useful when you forget a command that you need to run as sudo.
df -h
Human readable output of the disk space you have available on your drives.
du -h <directory>
Human readable output of the size of a given directory.
ln -s <source> <destination>
Create a symbolic link from <source> to <destination>. Think of symbolic links as aliases to files and directories which you can delete with rm without harming the original file.
tail -f <file>
This is one of the most essential commands I use. Use it on log files and anything else that changes frequently. It will update the display (follow) as new entries appear on the log file. Press space a few times to separate content if you want. Press control-c to stop tailing.
tail -f /var/log/*
This will tail follow all the files in /var/log.
watch ls
Takes you to a watch screen where the 'ls' command is executed once every 2 seconds, so you can monitor a directory for changes - new files etc.







MultiQuote





|