• Translate

10/23/2017

The Basic Commands on LINUX that You Must Know

Tutorial Software |

Advertisement

LINUX is one of the most widely used operating systems other than Windows and MacOS. Open Source based, this operating system has a variety of interesting features and easily modified so that became one of the reasons why hackers choose Linux than Windows.

In general, users who are used to using Windows or Mac will be a little confused when just starting to try Linux. In order not to get too blind when trying Linux, here alltutorials share some basic commands commonly used in Linux.

Basic Command on Linux

Basic Command on Linux
Here are all the basic Linux commands you should know when learning or trying Open Source Linux operating systems. Basic Commands Linux works on almost all versions of Linux, of course this will make it easier for you when trying Linux.
  • mkdir - create a directory
    Usage: mkdir [OPTION] DIRECTORY ...
    Example: mkdir lhn
  • ls - list directory list
    Usage: ls [OPTION] ... [FILE] ...
    Example: ls, ls l, ls lhn
  • cd - change directory
    Usage: cd [DIRECTORY]
    Example: cd lhn
  • pwd - print the current directory name
    Usage: pwd
  • vim – Vi Improved, a programmers text editor
    Usage: vim [OPTION] [file]…
    Example: vim lhn.txt
  • cp - copy files and directories
    Usage: cp [OPTION] ... SOURCE DEST
    Example: cp sample.txt sample_copy.txt
                  cp sample_copy.txt target_dir
  • mv - move (rename) the file
    Usage: mv [OPTION] ... SOURCE DEST
    Example: mv source.txt target_dir
                  mv old.txt new.txt
  • rm - delete files or directories
    Usage: rm [OPTION] ... FILE ...
    Example: rm file1.txt, rm rf some_dir
  • find - looking for something
    Usage: find [OPTION] [path] [pattern]
    Example: find file1.txt, find name file1.txt
  • history - prints recently used commands
    Usage: history
  • cat - unifies files and displays in standard output
    Usage: cat [OPTION] [FILE] ...
    Example: cat file1.txt file2.txt
                  cat n file1.txt
  • echo - displays a line of text
    Usage: echo [OPTION] [string] ...
    Example: echo I love India
                  echo $HOME 
  • grep - displays the corresponding line pattern
    Usage: grep [OPTION] PATTERN [FILE] ...
    Example: grep i apple sample.txt
  • wc - displays the number of lines, words and bytes of a file
    Usage: wc [OPTION] ... [FILE] ...
    Example: wc file1.txt
                  wc L file1.txt
  • sort - sorting
    Usage: sort [OPTION] ... [FILE] ...
    Example: sort file1.txt
                  sort r file1.txt 
  • tar - archives files
    Usage: tar [OPTION] DEST SOURCE
    Example: tar cvf /home/archive.tar /home/original
                  tar xvf /home/archive.tar
  • kill - turns off a process
    Usage: kill [OPTION] pid
    Example: kill 9 2275 
  • ps - displays the current process snapshot
    Usage: ps [OPTION]
    Example: ps, ps el
  • who - knows who is logged in
    Usage: who [OPTION]
    Example: who, who b, who q
  • passwd - update password
    Usage: passwd [OPTION]
    Example: passwd
  • su - replace USER ID or become super user
    Usage: su [OPTION] [LOGIN]
    Example: su remo, su
  • chown - change the file or group owner
    Usage: chown [OPTION] ... OWNER [: [GROUP]] FILE ...
    Example: chown remo myfile.txt
  • chmod - replace file permissions
    Usage: chmod [OPTION] [MODE] [FILE]
    Example: chmod 744 calculate.sh
  • zip - archiving files
    Usage: zip [OPTION] DEST SOURSE
    Example: original original zip.zip
  • unzip - opens ZIP archived files
    Usage: unzip filename
    Example: unzip original.zi
  • ssh - SSH client (remote login program)
    "Ssh is a program for logging into a remote machine and for executing commands on a remote machine"
    Usage: ssh [options] [user] @hostname
    Example: ssh X guest@10.105.11.20
  • scp - secure copy (remote file copy program)
    "Scp copies files between hosts on a network"
    Usage: scp [options][[user]@host1: file1][[user]@ost2:file2]
    Example: scp file1.txt guest@10.105.11.20:~/Desktop/
  • fdisk - partition manipulator
    Example: sudo fdisk l
  • mount - mount a file system
    Usage: mount t type device dir
    Example: mount /dev/sda5 /media/target
  • umount - unmount file systems
    Usage: umount [OPTIONS] dir | device ...
    Example: umount /media/target
  • du - view the storage capacity
    Usage: du [OPTION] ... [FILE] ...
    Example: du
  • df - see the amount of storage usage
    Usage: df [OPTION] ... [FILE] ...
    Example: df
  • quota - view usage and disk limits
    Usage: quota [OPTION]
    Example: quota v
  • reboot - restart the system
    Usage: reboot [OPTION]
    Example: reboot
  • poweroff - shut down system
    Usage: poweroff [OPTION]
    Example: poweroff
  • kate - KDE Editor
    Usage: kate [options] [file (s)]
    Example: kate file1.txt file2.txt
  • vim - Vi Improved, a programmers text editor
    Usage: vim [OPTION] [file] ...
    Example: vi hello.c
  • gedit - Text editor to create and edit files
    Usage: gedit [OPTION] [FILE] ...
    Example: gedit
  • bg - make the process in front running behind
    Usage: type 'ctrl+z' and then 'bg'
  • fg - keeps the background process running in front
    Usage: fg [jobid]
  • jobs - displays the ID and process name
    Usage: jobs
  • sed - stream editor for sorting and transforming text
    Usage: sed [OPTION] [inputfile] ...
    Example: sed 's/love/hate/g' loveletter.txt
  • awk - scan pattern and language processing
    Example: awk F: '{print $1}'sample_awk.txt
  • find - search in one directory
    Usage: find [OPTION] [path] [pattern]
    Example: find name file1.txt
  • locate - search
    Usage: locate [OPTION] ... FILE ...
    Example: locate file1.txt
Those are the basic Linux commands you must know to avoid being too blind when using Linux. If there are errors or things to say, do not forget to write them in the comments field. Good luck!

Disqus
Blogger
Comment
How to style text in Disqus comments Top Disqus Commentators
  • To write a bold letter please use <strong></strong> or <b></b>.
  • To write a italic letter please use <em></em> or <i></i>.
  • To write a underline letter please use <u></u>.
  • To write a strikethrought letter please use <strike></strike>.
  • To write HTML code, please use <code></code> or <pre></pre> or <pre><code></code></pre>, and please parse the code in the parser box below.
Show Parser Box

No comments Add Comment

Comments not appropriate topic will sign SPAM.