Copying,renaming,deleting files- Linux commands
so how mv is different from cp?. --
copy keeps original copy intact in its location , while making a copy at specified location while in mv we lose the file at original place
ln command:
with mv command we moved hello.txt under dir4,instead of accessing them as dir2/dir3/dir4/hi.txt everytime,we can create a link and after that,you can access or edit dir2/dir3/dir4/hi.txt file as simply hello
ln dir2/dir3/dir4/hi.txt hello
rm command:
will prompt you with a message.rm: remove regular empty file 'file2.txt'? type y to delete the file.To remove directory, first remove it's contents using option "r",
rm -ri dir50/*
Tips and tricks:
If you want to remove files content without begin prompted for confirmation use -f option. It's extremely dangerous to use "rm -rf",because you may delete very important files by mistake-so make sure you delete correct files before running rm -rf"
rm -rf junk/*
rmdir dir50
Comments
Post a Comment