SES by degreeadvantage.com

Wednesday, November 14, 2007


Copying File and Directory
:

a. Copy file:
Syntax:
# cp [source]filename [destination]

b. Copy directory
#cp –r [source]directory [destination]
to copy a directory into another directory recursively

c. cp –rf [source]directory [destination]
to copy a directory forcely

syntax used for copy file or directory:
cp [option] file destination
option:
-I : interactive : ask before overwriting file
-r : Recursive
-p : Preserve
-f : forcely

More than one file can be copied at a time if the destination is directory
Syntax:
cp [option] file1 file2 file 3 Destination

Moving and Renaming File and Directory

Syntax:
# mv : move /rename files and directory

Example:
# mv [option] file destination

example:
# mv t.txt /home/raj/
more than one file can be moved at a time if the destination is a directory

# mv [option] file1 file2 file3 destination


Getting Help:
The command that are used to get the help are discussed as :
a. Whatis
Display a short description of command , it uses a database that is updated nightly. Often not available immediately after installation.

Syntax:
# Whatis cal

b. Help
Display usage summary and argument list
Syntax:
--help
Example:
#Date –help

c. Man and Info:
Both provide documentation for command. Almost every command has a “man” page. Collection of pages are called linux manual.
# man date
# info date

Viewing Text Page
Syntax:
#less [option] [filename]
Example:
# less abc.txt
scroll with arrows/PgUp /PgDown

/text : search for text
n : Next Match

Option:
-c : Clear before displaying
-s : Squeeze multiple blank lines into a single blank line

Simply we can also use “less” along with pipe | as
# ll |less

No comments:

 
Free Search Engine Submission thanks to: Create a Website