Commands: $ logname  to check present working user. User2 $ clear



Download 122.5 Kb.
Page4/17
Date25.10.2023
Size122.5 Kb.
#62396
1   2   3   4   5   6   7   8   9   ...   17
Unix Commands
Creating a Directory

$ mkdir [dir name]  To create a Directory

$ cd [dir name]  To change into the Directory

$ mkdir [dir1] [dir2] [dir3] ....

  • To move back to Parent Directory

$ cd ..

$ cd ../..

  • To move three levels up from PWD

$ cd ../../..

$ cd

  • To change to Root Directory

$ cd /

Syn: $ cp [option] [source path] [destination path]
Options:
-i: 
Interactive. Prompt for confirmation whenever the copy would overwrite an existing file. A in answer confirms that the copy should proceed. Any other answer prevents cp from overwriting the file.
-p:
Preserve. Duplicate not only the contents of the original file or directory, but also the modification time and permission modes.


-R: 
Recursive. If any of the source files are directories, copy the directory along with its files (including any subdirectories and their files); the destination must be a directory.


cp refuses to copy a file onto itself.
Ex: $ pwd
/home/user2
To copy X1 directory into Y1.
$ cp –R /home/user2/X/X1 /home/user2/Y/Y1
(Or)
$ cp –R X/X1 Y/Y1
Note:
The difference between copy and move command is
After copying a file from source to destination the file is available at both source and destinations.
After moving a file from source to destination the file is available only at destination.


1   2   3   4   5   6   7   8   9   ...   17




The database is protected by copyright ©ininet.org 2024
send message

    Main page