Posted by: blueangel | April 5, 2011

Basic Commands for Windows Linux

Here you are provided with basic commands for Windows Linux:

  • You can use command [root@pc1 /]# cd /etc to change directory / to /etc
  • You can use command [root@pc1 etc]# cd ..to go to one step back /etc to /
  • You can use command [root@pc1 /]# cd – to move to previous working directory
  • You can use command [root@pc1 etc]# cd ~ to go to current login user home directory
  • You can use command [root@pc1 ~]#  dir  /etc to show the contents of /etc in single color
  • You can use command [root@pc1 ~]#  Ls  /etc to show the contents of /etc in different colors with nature of contents
  • You can use command [root@pc1  ~]#  mkdir  /disk to create a folder on root partition
  • You can use command [root@pc1  ~]#  mkdir  /disk/dir to create a folder in /disk
  • You can use command [root@pc1  ~]#  mkdir  /etc/dir1 /var/dir2 /usr/dir3 to create multiple folder in multiple directories with single command
  • You can use command [root@pc1  ~]#  mkdir  dir1 dir2 dir3 to create multiple folder in same directory
  • You can use command [root@pc1  disk]#  cp  file dir to copy a file in directory
  • You can use command [root@pc1  disk]#  cp  /disk/file /disk/dir to copy a file from /disk/file and paste it in /disk/dir/
  • You can use command [root@pc1  disk]#  cp  -r  dir  dir2 to copy a directory with –r option
  • You can use command [root@pc1  disk]#  cp  /disk/file  /etc/myfile to copy a file from /disk/file and paste it in /etc with myfile name
  • You can use command [root@pc1  disk]#  rm file to remove a file
  • You can use command [root@pc1  disk]#  rm –f  file to remove a file with forcefully option
  • You can use command [root@pc1  disk]#  rm dir to remove a directory with out –r option and you face will an error
  • You can use command [root@pc1  disk]#  rm  -r  /disk for removing a directory with –r option
  • You can use command [root@pc1  disk]#  rm  -rf  dir for removing a directory with forcefully option
  • You can use command [root@pc1  disk]#  mv  /etc/dir1  /disk/mydir to move /etc/dir1 to /disk/ with different name
  • You can use command [root@pc1  disk]#  mv  /disk/mydir  /disk/dir to rename the folder name mydir to dir
  • You can use command [root@pc1  disk]#  mv file myfile to rename the file name with myfile
  • You can use command [root@pc1  disk]# less  /etc/grub.conf to read a file page by page with less command
  • You can use command [root@pc1  disk]# more  /etc/qrub.conf to read a file page by page with more command
  • You can use command [root@pc1  disk]# head  /etc/grub.conf to read first ten lines of grub.conf
  • You can use command [root@pc1  disk]# tail  /etc/grub.conf to read last ten lings of grub.conf
  • You can use command [root@pc1  disk]# head  -n  12  /etc/grub.conf to read first 12 lines with –n option
  • You can use command [root@pc1  disk]# tail  -n 11  /etc/grub.conf to read last 11 lines with –n option
  • You can use command [root@pc1  disk]# cat  /etc/grub.conf > /disk/file to copy the contents of /etc/grub.conf in /disk/file
  • You can use command [root@pc1  disk]# cat  /etc/mtab >>  /disk/file to append the contents /etc/mtab in /etc/file
  • You can use command [root@pc1  disk]# cat  /etc/squid/squid.conf I more for merging tow commands with pipe sign output of the first command is input of second command
  • You can use command [root@pc1  disk]# cat  /etc/squid/squid.conf I wc  -L to count the total lines of squid.conf
  • You can use command [root@pc1  disk]# cat  /etc/squid/squid.conf  I grep  spool to show only spool words in squid.conf
  • You can use command [root@pc1  disk]# cat  /dev/null  >  /var/log/messages to flush the contents of file
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: