Linux Commands

Linux commands syntax consist of options and arguments. The syntax is command option(s) argument(s).

Options
  • Change the way a command works.
  • They contain a hyphen or dash followed by a letter.
  • Some commands can have multiple options which can be clubbed together after a hyphen.
Arguments
  • They are used along with multiple arguments.
  • Some commands take arguments automatically if none is provided.
  • They are not mandatory for some commands while needed by others
command --options/switches  argument

The commands which are used frequently are,

  1. The cd stands for change directory. It is used to navigate around the file system.
  2. The pwd stands for Present working directory. It used for getting the current working directory.
  3. The ls stands for a listing of directories/files of the current directory.
  4. The man command stands for manual. It gives a manual page for the specific commands.
  5. The clear command is used to clear the Linux terminal.
  6. The cat command is used to read the contents inside a file.

Let's learn these commands in detail in the upcomming articles.

Help Commands

There are three types of help commands. They are what is command, command --help and man command.

Linux vs Windows Commands

Some of the Linux vs Windows commands are listed below:

linux-fundamental60

Linux path completion

Path completion is a very helpful feature in any operating system. It is made to speed up your typing speed. You just have to hit the 'Tab' key and your command, option, or file name that is arguments will be automatically completed or will give you the options.

For example, if you want to type 'cd Downloads' you can type 'cd Do' and hit Tab. Your command will be automatically completed since there are two folders that start with Do they are Documents and Downloads.
auto-completion-linux

But to work the Tab key you have to type the first letter correctly. For example, if you will type 'cd do' followed by the Tab key then you won't get any result as there will be no files starting from 'do'.

Path completion is extremely helpful in typing long file names where you don't remember the full file name. Some files contain symbols or spaces which is difficult to keep in mind where you can use them.

Linux File Structure

In Linux, the file structure shows the way in which the files are named and where the files are logically placed and can be used for retrieval.

The different directories in a Linux file system are listed below:

  • / - Root directory of the entire file system hierarchy.
  • /boot - It is the system reserved file. All the files related to booting are in this file.
  • /root - It is the home directory for the root user. It is not similar to /.
  • /dev - It contains the files for peripheral devices that are attached to the Linux system.
  • /etc - It contains the configuration files.
  • /bin -> /usr/bin - It contains the common user commands.
  • /sbin -> /usr/sbin - It contains the commands for the root user.
  • /opt - The optional add-on application software are saved here.
  • /proc - It contains the text files related to the virtual file system and process status.
  • /lib -> usr/lib - It contains essential shared libraries and kernel modules.
  • /tmp - It contains temporary files.
  • /home - This directory is designed for users.
  • /var - The data which changes dynamically for every reboot is stored here.
  • /run - It contains the temporary runtime files like the process id files.
  • /mnt - It is the mount point for temporarily mounted file systems.
  • /media - mount point for removable media.

Linux File System

The file is the collection of data items stored on a disk. In Linux, everything is stored in the form of files.

A directory consists of a group of files. There are two types of directories they are,

  • Root directory : There is only one root directory in your system, which is denoted by "/". It is the parent or the root of your entire file system and it has control over all the users, files, and directories.
  • Subdirectory : The directory under the parent directory(/) is called the subdirectory.

Linux supports numerous file system types they are,

  • EXT2 : It is a UNIX-like file system. It has the concepts of blocks, inodes, and directories.
  • EXT3: EXT3 is the updated version of the EXT2 file system. EXT2 enhanced with journaling capabilities. Journaling allows fast recovery of system files when the system encountered a crash.
  • EXT4: It is the extended version of EXT3. Some of the features of EXT4 are compatibility,multi-block allocation, journaling checksumming, creation of larger file sizes, etc..,
  • ISOfs(iso9660): It is the worldwide standard of ISO used by CDROM file system.
  • Sysfs(System file system): It is a ram based file system initially based on ramfs files. It is used to export the kernel objects so that the end-user can use it easily.
  • Procfs(process file system): This file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change certain kernel parameters at runtime using sysctl command.
Linux File Types

Linux file types symbol and their meanings are listed below:

File Symbol Meaning
- Regular file
d Directory
l Link
c Device or special file.
s Socket
p Named pipe.
b Block device

File System Color Definition

The different color definitions for the file system are:

  • Blue: Determines directory.
    linux-filecolorblue
  • Green: Determines executable or recognized data file.
  • Sky Blue : Determines the symbolic link.
    linux-filecolorskyblue
  • Yellow with Black background : Determines device file.
    linux-fileyellow
  • Pink : Determines the graphic image file.
  • Red : Determines the archive file. (tar)
    linux-filecolorred
  • Red with Black background : Determines broken link. ( absolute path of the source file is missing)
    linux-filecolorredwithblack
We can change the color definitions and also all the Linux environments may not have the same color definition.
0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions