
linux terminal commands | linux command
linux basic commands, linux commands pdf, basic linux commands, linux commands with examples, linux command, useful linux commands, list of linux commands, red hat linux commands
Basic linux commands
1.ls -l for listing the files as well as directories those are kept in the particular working directory
syntax
[root@tatya root]#ls -l
2.ls -la same as 'ls -l'but by this command we can also see the hiden files.
syntax
[root@tatya root]#ls -la
3.ls -li same as 'ls -la' but it will also shows us the inode number of each and every file
syntax
[root@tatya root]#ls -li
4.ls by this command we can see only file names of folder
syntax
[root@tatya root]#ls
5.clear - It will clear the screen
syntax
[root@tatya root]#clear
6.exit - To end a current session as well current terminal logging
syntax
[root@tatya root]exit
7.touch - To create a new empty file
syntax
[root@tatya root]#touch
8.cd to change the present directory
syntax
[root@tatya root]#cd /home/Tatya
where '/home/Tatya' is the desired directory to be change from '/root'
9.cat - To view the contents of a file and it is also used for creating a new file with some contents
syntax
[root@tatya root]#cat <file name> to view file contents
[root@tatya root]#cat > newfilename enter,then you can write something in the file and then to save the file contents press clt+d then enter
10.mkdir to make a new directory
syntax
[root@tatya root]#mkdir newdirname
you can also create a directory at your desired path without changing your present working directory
syntax
[root@tatya root]#mkdir /home/tatya/newdirname
11.rm to remove a empty file
syntax
[root@tatya root]#rm filename
12.rmdir to remove a empty directory
syntax
[root@tatya root]#rmdir directoryname
13.rm [-i/-r/-f] to remove a directory with its subdirectories as well as its files that is to remove a directory which already contains some files in it
syntax
[root@tatya root]#rm -i directory or filename
-i stands for interactively
-r stands for recursively
-f stands for forcefully
14.cp to copy something in a destination file or directory
syntax
[root@tatya root]#cp sourcepath destinationpath
example: [root@tatya root]# cp/home/tatya/helloworld.txt /root/hello
In this example the helloworld.txt file will be copied in /root/hello directory
15.mv to move one file or directory from one place to another place, it is also used for renaming a directory or file
syntax
[root@tatya root]#mv source destination
[root@tatya root]#mv oldfilename newfilename
16.dir to view the subdirectories and filesn under the directory
syntax
[root@tatya root]#dir
17.su - to become a super user
syntax
[helloworld@tatya helloworld]$su -
output : [root@tatya root#]
18.pwd to view the present working directory
syntax
[root@tatya root]#pwd
19.rpm -ivh to intall a rpm package
syntax
[root@tatya root]#rpm -ivh packagename.rpm
rpm stands for 'redhat package manager'
-i stands for install
-v stands for verbose mode
-h stands for with hash sign(#)
20.rpm -q to querry about any rpm package
syntax
[root@tatya root]#rpm -q packagename
21.rpm -e to uninstall a rpm package
syntax
[root@tatya root]#rpm -e package
22.find / -name to find any file or directory in linux file system
syntax
[root@tatya root]#find / -name filename
23.userdel to remove a user from linux
syntax
[root@tatya root]#userdel satish
