Basic Commands in Linux
Basic Commands in Linux
4.if we want add or append more date to existed file or already created file
syntax = cat >> <existing file name>
eg= cat >> VP
here we have space to write anything
5.if we want create multiple files <touch file1 file2> like this
if we want give range to files we have to give filename with range = touch
file{1..50}
we have to use only flower brackets to give file range .
6.removing file
syntax = rm filename
we can also give range for deleting multiple files at time.
ex.rm f1{1..50}
if we want see command manual we have to use man along with command which command
we want know about the man
ex= man rm (here i want know about the rm so that why i use command prompt man)
man = manual.
8.coping files
if we want copy files we have to use cp(command) with source file and destination
directory.
ex.cp sourcefile destination directory (because one file wont store into another
file we have to use directory)
ex.cp(copingcommands) file(sourcefile) vpradeep(destination directory)
here we are using this if we know the path dir and source file ,or both source file
and dir in same place
thats why we are using this method
if we dont know about the path and source file location and directory
in this type situations we are using this method
9.copieng directories
if we want to know how to copy directories we have to use copy command that is (cp)
and after that source directory destination (<source directory destination> and
after that (<destination directory>)
ex.cp(copy command) vpradeep(source directory destination) vp(destination
directory)
cp vpradeep vp
it wont like this we have to use - rf to copieng the directories from one to
another to copy.
ex.cp -rf source directory destination directory.
if we want know original time of the file or dir we have to use (p)
to copy files or moving files for not changing the metadata
ex.cp -pvrf pradeep/vp/
**(we have to use pvrf must and should when we have to copy the files or move the
files)
11.moving a file
if we want to move file we have to use the command(mv) with source and destination
directory
ex.mv(moving command) file1(source file) pradeep(destination directory).