Home / Uncategorized / Basic Command of LINUX operating system for better computer.

Basic Command of LINUX operating system for better computer.

Basic Command of Linux :

Linux is an operating system . It is more efficient and powerful operating system in the world . It has many facilities such as open source, virus protected , reusable , popular , server based operating system etc. In this section we have described basic command for learning purpose .

LINUX

For changing directory / to /etc
[root@pc1 /]# cd /etc

One step back /etc to /
[root@pc1 etc]# cd ..
Go to previous working directory
[root@pc1 /]# cd –

Go to current login user home directory
[root@pc1 etc]# cd ~

Show the contents of /etc in single color
[root@pc1 ~]# dir /etc

Show the contents of /etc in different colors with nature of contents
[root@pc1 ~]# Ls /etc

create a folder on root partition
[root@pc1 ~]# mkdir /disk

Create a folder in /disk
[root@pc1 ~]# mkdir /disk/dir

Create multiple folder in multiple directories with single command
[root@pc1 ~]# mkdir /etc/dir1 /var/dir2 /usr/dir3

Create multiple folder in same directory
[root@pc1 ~]# mkdir dir1 dir2 dir3

Copy a file in directory
[root@pc1 disk]# cp file dir

Copy a file from /disk/file and paste it in /disk/dir/
[root@pc1 disk]# cp /disk/file /disk/dir

Copy a directory with –r option
[root@pc1 disk]# cp -r dir dir2

Copy a file from /disk/file and paste it in /etc with myfile name
[root@pc1 disk]# cp /disk/file /etc/myfile

Remove a file
[root@pc1 disk]# rm file

Remove a file with forcefully option
[root@pc1 disk]# rm –f file

Remove a directory with out –r option and you face will an error
[root@pc1 disk]# rm dir

Remove a directory with –r option
[root@pc1 disk]# rm -r /disk

Remove a directory with forcefully option
[root@pc1 disk]# rm -rf dir

Move /etc/dir1 to /disk/ with different name
[root@pc1 disk]# mv /etc/dir1 /disk/mydir
Rename the folder name mydir to dir
[root@pc1 disk]# mv /disk/mydir /disk/dir

Rename the file name with myfile
[root@pc1 disk]# mv file myfile

Read a file page by page with less command
[root@pc1 disk]# less /etc/grub.conf

Read a file page by page with more command
[root@pc1 disk]# more /etc/qrub.conf

Read first ten lines of grub.conf
[root@pc1 disk]# head /etc/grub.conf

Read last ten lings of grub.conf
[root@pc1 disk]# tail /etc/grub.conf

Read first 12 lines with –n option
[root@pc1 disk]# head -n 12 /etc/grub.conf

Read last 11 lines with –n option
[root@pc1 disk]# tail -n 11 /etc/grub.conf

Copy the contents of /etc/grub.conf in /disk/file
[root@pc1 disk]# cat /etc/grub.conf > /disk/file

Append the contents /etc/mtab in /etc/file
[root@pc1 disk]# cat /etc/mtab >> /disk/file

Merging tow commands with pipe sign output of the first command is input of second command
[root@pc1 disk]# cat /etc/squid/squid.conf I more
Count the total lines of squid.conf
[root@pc1 disk]# cat /etc/squid/squid.conf I wc -L

Show only spool words in squid.conf
[root@pc1 disk]# cat /etc/squid/squid.conf I grep spool

Flush the contents of file
[root@pc1 disk]# cat /dev/null > /var/log/messages

 

Share

About RBonlin@ECareer

Check Also

Run First Your Computer

How To Make Run First Your Computer,Laptop 5 Minute

Generally, everyone is comfortable with using high-speed computers, But computers have lost their speed due …

3 comments

  1. I’m not quite sure how to say this; you made it exelrmtey easy for me!

  2. I simply want to say I’m all new to blogging and definitely enjoyed you’re web-site. Almost certainly I’m likely to bookmark your blog . You absolutely have exceptional stories. Kudos for revealing your website.

  3. This is really nice to know. I hope it will be successful in the future. Good job on this and keep up the good work.

Leave a Reply

Your email address will not be published. Required fields are marked *