Basic Linux commands
$ mkdir [ directory name ]
mkdir command is used to create new directory. Let’s create a example directory.
$mkdir example
we can also use this command to make more then 1 directory at same time,
$mkdir -p a b c d e f g h i j k l
This command will create many directory at same time.
$mkdir -p a/b/c/d/e/f/g/h/i/j/k
This will create directory inside each other.
$mkdir -p a/{b,c,d,e,f,g,h,i,j,k}
$mkdir -p a/computer{b,c,d,e,f,g,h}networking
this command will create directory like this
[root@localhost c]# mkdir -p a/computer{b,c,d,e,f,g,h}networking
[root@localhost c]# tree
.
`-- a
|-- computerbnetworking
|-- computercnetworking
|-- computerdnetworking
|-- computerenetworking
|-- computerfnetworking
|-- computergnetworking
`-- computerhnetworking
8 directories, 0 files
[root@localhost c]#
$ cat [ file name ]
now create a file. Syntax for creating file is
$cat > [file name]
This command can be used in three way
To create a new file
To append the contents of file.
$cat [file name] ------------------------ To see the contents of file
$cat > [file name]---------------------- To create a file
$cat >> [file name ]-------------------- To append the contents of file
$ cd [ destination directory path]
It is easy to change directories in Linux. Just use cd and name the absolute path of the desired directory. If you use the relative path, just remember that your final destination depends on the present working directory.[root@localhost c]# cd /
No comments:
Post a Comment