Linux Commands

Linux Shell or “Terminal”

A shell is a program that receives commands from the user and gives it to the OS to process, and it shows the output. Linux's shell is its main part. Its distros come in GUI (graphical user interface), but basically, Linux has a CLI (command line interface).

Linux Basic Commands

pwd command

‘pwd’ command prints the absolute path to current working directory.

$ pwd
/home/infomax

cal command

Displays the calendar of the current month.

$ cal

echo command

This command will echo whatever we provide it.

 $ echo "programmingtrick.com"
infomaxacademy.com

date command

Displays current time and date.

 $ date
Fri Jul 6 01:07:09 IST 2012

clear command

This command clears the screen.

$ clear

 Linux Filesystem commands

Changing Directories  (CD) Command

$ cd [path-to-directory]
$ cd /usr/share/ 

Listing File And Directories Command

ls Command

$ ls [files-or-directories] 

List files and/or directories. If no argument is given, the contents of current directory are shown.

$ ls 

Creating/Deleting files and directories

mkdir command

To create a directory, the ‘mkdir’ command is used.

$ mkdir olevel 

rm Command

To remove a directory, the 'rm' command is used

rmdir directoryname


Qus. 1 : Which of the following is a Linux command?

  1. Chmod
  2. curl
  3. df
  4. all
Qus. 2 : Command to create file in Linux is...........?

  1. copycon
  2. cat
  3. dir
  4. All of the above
Qus. 3 : Which command is used to check Linux version?

  1. uname -a
  2. uname-n
  3. uname-s
  4. kernel
Qus. 4 : True statement about 'chown' command in Linux is

  1. Creates a thread
  2. Creates a child process
  3. Changes the mode of operation to kernel mode
  4. Changes the users and/or group ownership of each given file
Qus. 5 : Which commands will give you information about how much disk space each file in the current directory uses?

  1. Is-1
  2. ls -la
  3. du
  4. ls -a
Qus. 6 : Which command is used for removing files in the Linux operating system ?

  1. delete
  2. rm
  3. dm
  4. erase

Programs

Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad