Linux /? Help

Linux Newbie Help Area






Manipulating files


cp - copy one or more files

Format
cp [options] source-file destination-file
cp [options] source-file-list destination-directory

Summary
The program has two modes. You can copy one file into another. Or copy a file from one place to another.
You can use wildcards * and ?.

Options
-r    Copies directories recursively. With this i mean that all files including subdirectories and their content given by source-file-list will be copied to the destination directory.

df - disk free displays the amount of available disk space

Format
df [options] [filesystem-list]

Summary
If you don't specify the filesystem-list, df will list the amount of available disk space on all mounted filesystems

Options
-t type, causes df to display information about the type of the filesystems of the specifies type.


du - disk used

Format
du [directory-list]

Summary
Lists the diskspace used by the directory and its contents specified by the directory-list argument


find - find a file

Format
find directory expression

Summary
directory specifies the directory where you want the search to start. Find will search all directories recursively.
expression is the search argument. These are the most common used:

Search arguments
-name filename,     searches for the given filename
-user name,     list all files who are owned by the given users
-size +/-n,     lists all files with size smaller/greater than n


ln - make a link to a file

Format
ln [option] existing-file new-link

Summary
Creates a hard link to the file specified by existing-file with the name given by the new-link argument. A hard link to a file is indistinguishable from the original. A hard link has to be on the same filesystem as the original file. A symbolic link may be across filesystems and existing file and new-link may be directories as well as files.

Options
-s creates a symbolic link instead


locate - locates files

Format
locate pattern

Summary
Lists all files in filedatabase that match the given pattern.
This utility depends on a database file with al list of all files on your filesystem. Use the updatedb utility to update your database (caution, this takes a while)

Example
#locate hepp
This search would find all files on you system that contain hepp. It would find heppgr, tghepp and tyheppl.

mkdir - make directory

Format
mkdir [options] directory-list

Summary
Creates a new directory. If you write #mkdir test, mkdir creates a new directory with the name "test" in the current directory.         
If you want mkdir to make a directory in another directory, you must specify the whole directory path.

Options
-p parent, if the parent directory of the directory you are creating does not exist, mkdir will create it for you.

mv - move files

Format
mv [options] source-path destination-path

Summary
Copies the the files specified in source-path to destination path and then deletes the original files.
You can use wildcards * and ?.


rm - remove files

Format
rm [options] file-list

Summary
This utility removes files from your system. You can use wildcards * and ?.
Note: when you delete a file it is not possible to recover it.

Options
-r     recursive, this option makes rm remove the specified directory and all of its contents. (MS USERS: Just like deltree) BE CAREFUL WITH THIS COMMAND!!
-f     force, this option makes rm delete files without asking you if you really want to. Nice if you want to delete directories.

rmdir - remove directory

Format
rmdir directory-list

Summary
Removes all directories specified by directory-list.
Note: The directories you want to delete must be empty. If they are not, mkdir will fail. If you want to delete a directory together with its contents use rm.


Table Of Contents





webmaster@webpromo-inc.com


© Linux /? Help - WebPromotions 2001 Company Ltd.