Professional Documents
Culture Documents
Linux Basic Commands
Linux Basic Commands
--------------------------
1)/ ->root or parent directory
2)pwd ->it displays present working directory
3)/root -->Is the default home directory for user root
4)cd ->to change the directory
creation of files:
-----------------------
->we can create files in three ways..1)cat 2)touch 3)vi
syntax:touch filename
ex:
----
1)creation of single file:
---------------------------
-> touch aws (here aws is the file name)
cat:- it is used to create new files or to open existing files or to append data to
the existing files.
-----
syntax:cat > filename
ctrl d
cat sample
ctrl d
cat sample > linux (here the content of sample redirect to linux)
Deleting Files:
----------------
rm:- this command is used to delete a file
syntax: rm filename
ex: rm aws
->rm: remove regular empty file 'aws' ? y
->file is deleted
creation of directories:
-------------------------
->mkdir: this command is used to create a new directory
syntax: mkdir dirname
NOTE:
-----
# cd --to come out the directory
Removing directories:
----------------------
rmdir: to remove a directory but directory must be empty
Copying a files:
----------------
cp: this command is used to copy a files
->source file must be existing file and target file may be new file or may be a
existing file.
NOTE:
------
1)Any path starts from ("/") root directory known as Absolute path.
2)If path not started with ("/") root directory known as Relative path.
ex:-
-----
1) cp notepad notepad1 (here not is al existing file and notepad1 is the new
file)
some commands:
---------------
5)ls -t (it list all files based on date and time of creation)
8)whoami (it display the switched user name or child user name)
ctrl d
->it is used for to create new files ,to open files or to modify existing files
1)command modes
2)input or insert modes
3)Ex command mode
-> vi filename
modes:
--------