cd -
ls -lt | tr -s " " | cut -f6-10
ls -i "Some silly (name)" the "-i" flag will display the file's inode:53273 Some silly (name)
find . -inum 53273 -exec mv \{\} NewName \;
echo $?
~/.bashrc.
forall() {
if [ $# -eq 0 ]; then
echo Usage 1: forall directory string
echo Usage 2: forall directory filepattern string
return 1
elif [ $# -eq 2 ]; then
echo "Searching in directory: $1 for all files, after the string: $2"
find $1 -type f -exec grep --color=auto -Hn "$2" {} \;
elif [ $# -eq 3 ]; then
echo "Searching in directory: $1 for files with name: $2 after the string: $3"
find $1 -iname "*$2" -type f -exec grep --color=auto -Hn "$3" {} \;
fi
}$ find . -naem "*.txt" -print find: invalid predicate `-naem'
$ ^em^me^ find . -name "*.txt" -print
sudo rm -i `sudo symlinks -r /usr/share/man | grep dangling | awk {'print $2'}
psnup -4 file.ps > file.ps, and print that.
sudo lsof -i TCP:1-65536
~/.Xresources file.
To load the settings, execute:xrdb -merge ~/.Xresources~/.xsession, remember to add the above.
perl -pi -e "s/org/replace/g;" 'find . -name "*.text"'
#!/usr/bin/perl -p
# Convert UTF-8 to iso8859-1, or to "{" "UTF8:" utf8-char "}" and return error.
# NOTE!Do not remove the code that checks if the UTF-8 sequence
#is valid and can be converted to iso8859-1.
#Otherwise filters like this can be fooled into converting
#some 8-bit chars to \0 or control characters.
# 1. octet in non-ASCII char should be [\300-\377]. However, we check
# for [\200-...] in case the input starts in the middle of a UTF-8 char.
s/([\200-\377][\200-\277]*)/&utf2iso($1)/ge;
sub utf2iso {
my($first,@rest) = unpack('C*', $_[0]);
$first -= 0xC2;
if (@rest != 1 || ($first & ~1)) {
warn "\nutf2iso: Non-iso8859-1 characters(s) in text.\n" unless $w++;
return "{UTF8:$_[0]}";
}
chr($first * 0x40 + $rest[0]);
}
END { die "utf2iso: $w non-iso8859-1 characters.\n" if $w && $w > 1;#!/usr/bin/perl -wp
# Convert iso8859-1 to UTF-8
s/([\200-\377])/pack('CC', 0xC0 + (ord($1) >> 6), (ord($1) & 0xBF))/ge;
ssh -N -L localport:destination-host:destport ssh-server
ssh-keygen -t dsa/root/.ssh/authorized_keys (for example: cat id_rsa_backuphost.pub > /root/.ssh/authorized_keys )command="run-my-backup-system.sh"
command="rdiff-backup --server"" ssh-rsa AAAAB...(rest of my key)
/etc/ssh/sshd_config to PermitRootLogin forced-commands-only
ssh-agent you only need to enter your password for your ssh-key once. To do this ssh-agent has to be running and then you can simply type: ssh-add in a xterm. I run ssh-agent from my ~/.xsession like this:
#! /bin/sh ssh-agent $HOME/.xsession-real
$HOME/.xsession-real contains my normal .xsession, which starts my window manager.
mkdir cvs_repository export CVSROOT=/path/to/cvs_repository cvs init
cd sources cvs import -m "Imported sources" modulename vendortag releasetag
If you would like CVS to write information about revision and date in the header of your files, paste one of there files, depending on the file type, into you file (using LaTeX as example):
%%% CVS version control block - do not edit manually %%% $RCSfile: compiling-from-source.xml,v $ %%% $Revision: 1.3 $ %%% $Date: 2004/10/03 20:30:49 $ %%% $Source: /home/enrique/Development/CVS_REPOSITORY/Homepage/linux/software/compiling-from-source.xml,v $
%%% CVS version control block - do not edit manually %%% $RCSfile: compiling-from-source.xml,v $ %%% $Revision: 1.3 $ %%% $Date: 2004/10/03 20:30:49 $ %%% $Source: /home/enrique/Development/CVS_REPOSITORY/Homepage/linux/software/compiling-from-source.xml,v $
cvs diff -r X -r Y filename where X and Y are revisions, or you can use
cvs diff -D "1 hour ago" filename
If you want a "Live checked out" directory, which always contain an uptodate version of you sources, you can do this by editing CVSROOT/loginfo:
cvs co CVSROOT and then add the following:
^modulename (date; cat; (sleep 2; cd /path/to/live/checkout; cvs -q update -d;) &) >> $CVSROOT/CVSROOT/updatelog 2>&1
$CVSROOT/CVSROOT/updatelog contains a log of the autocheck out.
texconfig as root.
Select hyphen then latex, and uncomment the line with your language.
/etc/runlevels. Use rc-update to edit which services should start in which profile.
Next add the following to /etc/lilo.conf or if you are using a PPC machine, /etc/yaboot.conf:
Image=/boot/vmlinux-2.6.7-mm5
label=New
root=/dev/hda4
read-only
append="softlevel=nonetwork"g-cpan.pl command to install modules from CPAN.