-f | force operation without querying (takes precedence over -i) |
-i | query before removing or overwriting files |
-R or -r | recursively operate on directories |
cd [directory] | S |
Change the current directory. Without argument changes to home directory. cd - changes to previous directory. | |
chgrp [-Rf] group file[s] | U |
Change the group ownership of files | |
chmod [-Rf] mode file[s] | U |
Change the access permissions of files. Mode can be an (octal) value where the digits denote user (100), group (10) and other's (1) permissions and the bits in the digit denote read (4), write (2) and execute (1) permission. Example: 710 sets all permissions for the owner and execute for group. Mode can also be a string of letters (ugoa for user, group, others or all) followed by an operator +-= to add take away or assigning permissions followed by the permissions rwx for read, write and execute. Example: g+w adds group write permissions to the file[s]. On AFS file systems only the user permissions are respected, the group and others permissions are ignored! | |
chown [-Rcfv] [user][:group] file[s] | U |
Change the user (and group) ownership of files. | |
cp [-fip] source destination | U |
cp [-fip] source[s] directory | |
Copy files. With -p preserve owner, group and time stamps in the copied file[s]. | |
cp -r [-fip] sourcedir targetdir | U |
Copy files recursively, i.e. a whole directory tree. GNU versions of cp support the -a flag, which is similar but superior to -rp. | |
dd [if=file] [of=file] [further options] | U |
Low level copy command. Can be used to copy floppy disk images. Example: dd if=diskimage of=/dev/fd0 bs=1440k count=1 | |
df [-k] [file] | |
Summarize free disk space. Displays free disk space in blocks (-k in kbytes) of all mounted file systems or of the file system where file is found. Very system dependent. On HP-UX bdf is more useful than df. Use the GNU version gdf on non Linux systems. For AFS see fs. | |
du [-ks] [dir[s]] | U |
Summarize disk usage in units of disk blocks (-k in kbytes). With -s display only the grand total, otherwise report recursively on each directory. | |
file [-m magic] file[s] | U |
Determine file type based on the first bytes of the files using rules in the system magic file or in magic. The GNU version gfile (Linux: file) is sometimes more up to date while the system version sometimes reports more precise system specific file types. | |
groups [username[s]] | U |
Print the groups a user is in | |
id [-gnru] [username] | U |
Print real and effective UIDs and GIDs. Some systems accept (only or in addition) the option -a. | |
ll [option[s]] [file[s]] | A |
Shorthand for ls -l. Additional options as for ls can be given. | |
ln [-fs] file new_name | U |
ln [-fs] dir[s] new_directory_name | |
Make links between files. Hard links can be established within a file system only (not within AFS). Symlinks (with -s) are more flexible and visible. | |
ls [-acdFlLnrRtu] [file[s]] | US |
List contents of directories. The most frequently used options are -a list all entries, including those starting with a dot (.) -b print octal escapes for nongraphic characters -c use time of last inode modification (with -l, -n and -t) -d if the argument is a directory, list only its name, not its contents -F append /, * and @ to filename for dirs, executables and symlinks resp. -l list in long format (mode, number of links, owner, group, size, time) -L if the argument is a symbolic link, list the file it is pointing to -n like -l, but display UID and GID instead of owner and group -r reverse order of sort (alphabetic or by time) -R recursively list subdirectories -S sort by file size (only in the GNU version available) -t sort by time instead of by name (default: last file modification time) -u use time of last access (with -l, -n and -t) The GNU version of ls supports listings colorized according to file type. | |
lsize [directory] | A |
List contents of directories by size. Only the 20 largest files are printed. This is similar to ls -lS in the GNU version of ls. | |
lt [option[s]] [file[s]] | A |
List contents of directories by file modification time (long form). Similar to ls -lt. Additional options as for ls can be given. Only the 20 newest files are printed. Useful also in conjunction with options -r (display the oldest files), -u (sort by access time) and -c (sort by inode modification time). | |
mkdir [-p] [-m mode] dir[s] | U |
Make directories. With -p a directory hierarchy can be created. | |
mv [-fi] source destination | U |
mv [-fi] source[s] directory | |
Rename source file to destination file or move source files[s] into directory. | |
newgrp [-] [-l] [group] | US |
Change group ID to group or back to group (-) in passwd entry. | |
pwd | US |
Print name of current/working directory | |
quota [-v] | U |
Display disk usage and limits. Report quota on file systems, where the user has disk quotas. To identify files for removal the commands du, lsize, lt -r, lt -ru, find and locate are useful. | |
rcp [-pr] source destination | U |
Remote file copy. Depreciated, use the more secure scp instead. The arguments are of the form [[user@]host:]filename. With -p preserve owner, group and time stamps in the copied file[s]. | |
rm [-fi] file[s] | U |
rm -r [-fi] dir[s] | |
Remove files (or for -r whole directory trees). | |
rmdir [-p] dir[s] | U |
Remove empty directories (and with -p its empty parent dirs as well) | |
rsync [-ah] source destination | U |
Remote file copy. Option -h outputs usage information. Allows to transfer just the differences between two sets of files. The arguments are of the form [[user@]host:]filename. The most useful option -a allows to recursively copy directories by preserving inode information (syncing directories). | |
scp [-pr] source destination | P |
Secure remote file copy. With -p preserve owner, group and time stamps in the copied file[s]. The arguments are of the form [[user@]host:]filename. | |
touch [-r ref_file] [-t MMDDhhmm[YY]] file[s] | U |
Change file access and modification times. Used to create empty files. Timestamps can be set (-t) or copied from ref_file (-r). The time format for -t is plattform dependent. Please consult the man page or use the GNU version. | |
umask [mask] | S |
Get or set file-creation mode mask. The files get created with permissions 0777 - mask (dirs and executables) or 0666 - mask for other files (usually mask = 022 ). See chmod for the meaning of the mode bits in mask. |