Cross platform commands for Windows and Unix

Ch is a C compatible platform-independent shell. The following tables contain a summary of commonly used commands portable across different platforms in Ch under both Unix and Windows. The commands are listed below by category. These commands are very useful for shell programming in Ch.

If you are interested in knowing more about Ch shell programming, click here.

1. File Systems
CommandUsage
cd change working directory
chgrp change the group of a file or library
chmod change the access permission of a file
chown change the owner of a file or library
cp copy files or directories
dd use to block input/output operations on files and performing conversions on them
df ("disk free") reports available space and space in use in drives accessible by your system
du report the amount of disk space used by a hierarchy of directories
find search for files or directories that match a certain criterion, i.e. name, modification time etc
ln make a hard link or symbolic link
ls list contents of directory
mkdir create a new directory
mv rename files or move them to other directory
pwd print name of working directory
rm remove files or directories
rmdir remove directories
touch create a new empty file or update the modification time of an existing file
wget a non-interactive network retriever
which show the full path of commands, functions, header files

2. Binary Files
CommandUsage
ar archive maintenance utility; create libraries to be linked to other programs
nm list the symbol in an executable, object file or libary
ranlib generate an index for an ar format archive; enables faster linking
size print the sizes of sections in object files and executable programs
strings print the ASCII text strings embedded in binary file
strip remove debugging symbols and line number information from files to make file smaller
wget Download files using http or ftp URL
curl Download files using http or ftp URL
hexdump Dump files in hexadecimal numbers and ASCII characters

3. Text Files
CommandUsage
awk scan one or more files and perform an action on all of the lines that match a particular conditon
cat concatenate files together and send the result to the standard output
cksum calculate a CRC checksum for files
csplit context based file splitter
cut cut out selected fields of each line of a file
egrep search a file for a pattern using full regular expressions
expand replace the tabs in a file with a specified number of spaces
fgrep searched a file for fixed-character string
fmt simple text formatters
fold wrap files to fit in a specified number of columns
grep include also grep,egrep and fgrep; search for patterns matching on lines in a file
head print a specified number of lines from the beginning of a file
indent formatter for C source code
join conditionally merge two files together based on matching fields in the files
less a display paginator similar to more and pg in UNIX
make update a file based on a series of dependency rules stored in a special format
md5sum calculate a "fingerprint" for files using the MD5 algorithm
more copy by the screenful
nl add line number to files
od dump the contents of a file in a number format, including octal,hex and several ASCII format
patch apply changes to files
paste merge multiple files together into one file by concatenating lines from each file to form one line in the output file
pr pring files
sed "stream editor" based on the line editor ed; useful for editing streams of data
sort sort lines in a file based on fields in the file
split cut files into multiple fixed size pieces
sum calculate a simple checksum for files
tail print a specified number of line from the end of a file
tr character translation
tsort topological sort
trofftypeset or format documents
unexpand "unexpand" sequences of a specified number of spaces into tab characters
uniq remove duplicate lines from a sorted file
vi screen text editor
vim improved vi with syntax highlighting for Ch
wc count characters, words and/or lines in a file

4. Comparing Files
CommandUsage
cmp compare two files and display the line and byte number differences
comm report common lines in two files
diff compare files, showing lines that differ in any of serveral formats
diff3 compare three files
sdiff compare two files side by side and interactively merges them into a third file

5. Shell Utilities
CommandUsage
basename echo its argument, a file name, minus any directory name
date display date and time of the system
dirname print the directory component of file name
echo print its argument\\
env used to modify the environment in which a program is run
expr evaluate various types of expressions involving arithmetic,relational,logical and string operators
factor get all prime factors for a positive integer
hostname the name of the local host machine
id display the user and group IDs and names
lognamedisplay the user's login name
pathchk check path names
printenv ouput the environment under which a command will execute
sh the Bourne shell
sleep stop all actions in a shell for a specified period of time
tee copy its standard input to files named on the command line and also to standard output
uname display information about computer system; set node name (system name)
whoami display the login name
xargs construct argument lists and invoke utility

6. Archiving Files
CommandUsage
cpio file archiving and backup utility
gzip file compression program; does both compressing and uncompressing
gunzip same as gzip
tar create and manipulate tar archives