[Home] [Linguistics:] [Fielework:] [Databases:] [Linux:] [Debian:] [Windows:] [Miscellaneous]

Linux Command References

CVS
rsync
tr

find
ls
nkf
tar

CVS

Settings

Do the followings when you first use CVS:

Firstly, decide your cvs directory in which your files will be saved (imported) in a repository.

$cd /HOME
$sudo mkdir cvs [I will use /HOME/cvs to import files ro directories]
$sudo cvs init [This will create CVSROOT in /HOME/cvs]

Secondly, change ~/.bashrc as shown below:

$ emacs ~/.bashrc [add the following line to the file.]

$ export CVSROOT=/HOME/cvs [this is where your files and directories will be imported to do cvs.]
$ export CVSEDITOR=/usr/bin/emacs21 [using emacs21. If using nano =/usr/bin/nano. ]

Thirdly, import your files or directories (for example, files in MY.WORKING.DIRECTORY) to /HOME/cvs by doing:

$ cd /MY.WORKING.DIRECTORY
$ sudo cvs import my.work vox start [This will import eveythin in MY.WORKING.DIRECTORY into /HOME/cvs and the project name of MY.WORKING.DIRECTORY is my.work.]

Fourthly, checkout your files or directories to MY.WORKING.DIRECTORY or whichever directory you want to work.

$ sudo cvs checkout -d /MY.WORKING.DIRECTORY my.work [In this example, I overwrite /MY.WORKING.DIRECTORY. If you want to checkout (download) files and directories into other directory, change the path.]

After the four steps above, you can cvs with the commands below.

Commands

Import: creating your project

$ sudo cvs import -m "" your.project.name vox start

Checkout: checking out files from your project directory

$ sudo cvs checkout -d /home/your.directory.to.work/ YOUR.PROJECT.NAME [ The option -d specifies your directory to work.] Status: If up-to-date is shown, files are the latest $ sudo cvs status

Commit: uploading your files to your project directory

$ sudo cvs commit [file.name] [if you don't want to commit all files in the directory, add file name to commit.]

Update: checking out (downloading) particluar files from your repository

$ sudo cvs update -p salsa.tex > salsa.tex [to checkout the file,salsa.tex.]

$ sudo cvs update -p -r 1.5 salsa.tex > salsa.tex [to checkout version 1.5 of the file,salsa.tex.]

$ sudo cvs update -dP [to check out all files in the directory]

Add: adding a new files to repositories

$ sudo cvs add salsa.new.tex [to add a new file, salsa.new.tex to the project.]

Remove: removing files from repositories

$ sudo cvs remove -f salsa.old.tex

cvs remove: scheduling `salsa.old.tex' for removal
cvs remove: use 'cvs commit' to remove this file permanently

$ sudo cvs commit [to remove the file, salsa.old.tex permamently from your repository.]

rsync

# rsync -avun --delete --exclude='*~' [Source] [Destination]

Examples:

$ sudo rsync -avun --exclude='*~' --exclude='~*' --exclude='*.toc' --exclude='*.aux' --exclude='*.dvi' --exclude='*.log' --exclude='*.lof' --exclude='*.blg' --exclude='*.dat' --exclude='*.lot' --exclude='*.html' --exclude='*.prb' --exclude='CVS' /SOURCE/ /DESTINATION/

tr

When type set tex files which are editted on linux on windows, the code ^M may cause problems to type set the files. If you remove the code, you should be able type set the files.

To remove ^M in the end of lines:

$ tr -d '\r' < inputfile > outputfile

The option -d is `delete'.

find

Usages:

$ cd /dance [change directory to /dance]
/dance$ find . -name salsa [list files `salsa' in /dance]

ls

POSIX/GNU GNU long Functions
-a --all list all files
-l --format=long list details
-t --sort=time list in time order

nkf

$ nkf -option input_file_name > output_file_name

Options Functions
-j JIS code
-s S-JIS (MS-Kanji) code (This is for Meadow.)
-e EUC code
-g check current encoding


Links:

tar

$tar xvzf *.tar.gz

$tar jxvf *.tar.bz2